DAOs with singular/plural options for entity titles
[civicrm-core.git] / CRM / Financial / DAO / FinancialTrxn.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
ca5cec67 5 * @copyright CiviCRM LLC https://civicrm.org/licensing
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Financial/FinancialTrxn.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
7b66c3b5 9 * (GenCodeChecksum:857c64b471d1872d98141aefa56aecb6)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the FinancialTrxn entity.
f41f0342 14 */
e501603b 15class CRM_Financial_DAO_FinancialTrxn extends CRM_Core_DAO {
929a1c14
CW
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '1.3';
c3fc2621 18
e501603b 19 /**
f41f0342 20 * Static instance to hold the table name.
e501603b
TO
21 *
22 * @var string
23 */
fa45b5b9 24 public static $_tableName = 'civicrm_financial_trxn';
c3fc2621 25
e501603b 26 /**
f41f0342 27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 28 *
c3fc2621 29 * @var bool
e501603b 30 */
fa45b5b9 31 public static $_log = TRUE;
c3fc2621 32
e501603b 33 /**
e6ca0a57 34 * @var int
e501603b
TO
35 */
36 public $id;
c3fc2621 37
e501603b
TO
38 /**
39 * FK to financial_account table.
40 *
e6ca0a57 41 * @var int
e501603b
TO
42 */
43 public $from_financial_account_id;
c3fc2621 44
e501603b
TO
45 /**
46 * FK to financial_financial_account table.
47 *
e6ca0a57 48 * @var int
e501603b
TO
49 */
50 public $to_financial_account_id;
c3fc2621 51
e501603b
TO
52 /**
53 * date transaction occurred
54 *
55 * @var datetime
56 */
57 public $trxn_date;
c3fc2621 58
e501603b
TO
59 /**
60 * amount of transaction
61 *
62 * @var float
63 */
64 public $total_amount;
c3fc2621 65
e501603b
TO
66 /**
67 * actual processor fee if known - may be 0.
68 *
69 * @var float
70 */
71 public $fee_amount;
c3fc2621 72
e501603b
TO
73 /**
74 * actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.
75 *
76 * @var float
77 */
78 public $net_amount;
c3fc2621 79
e501603b
TO
80 /**
81 * 3 character string, value from config setting or input via user.
82 *
83 * @var string
84 */
85 public $currency;
c3fc2621 86
e501603b
TO
87 /**
88 * Is this entry either a payment or a reversal of a payment?
89 *
e6ca0a57 90 * @var bool
e501603b
TO
91 */
92 public $is_payment;
c3fc2621 93
e501603b
TO
94 /**
95 * Transaction id supplied by external processor. This may not be unique.
96 *
97 * @var string
98 */
99 public $trxn_id;
c3fc2621 100
e501603b
TO
101 /**
102 * processor result code
103 *
104 * @var string
105 */
106 public $trxn_result_code;
c3fc2621 107
e501603b
TO
108 /**
109 * pseudo FK to civicrm_option_value of contribution_status_id option_group
110 *
e6ca0a57 111 * @var int
e501603b
TO
112 */
113 public $status_id;
c3fc2621 114
e501603b
TO
115 /**
116 * Payment Processor for this financial transaction
117 *
e6ca0a57 118 * @var int
e501603b
TO
119 */
120 public $payment_processor_id;
c3fc2621 121
e501603b
TO
122 /**
123 * FK to payment_instrument option group values
124 *
e6ca0a57 125 * @var int
e501603b
TO
126 */
127 public $payment_instrument_id;
c3fc2621 128
ea927522
PN
129 /**
130 * FK to accept_creditcard option group values
131 *
e6ca0a57 132 * @var int
ea927522 133 */
5e0343e8 134 public $card_type_id;
c3fc2621 135
e501603b
TO
136 /**
137 * Check number
138 *
139 * @var string
140 */
141 public $check_number;
c3fc2621 142
ea927522
PN
143 /**
144 * Last 4 digits of credit card
145 *
4e0ede5a 146 * @var string
ea927522
PN
147 */
148 public $pan_truncation;
c3fc2621 149
1f34d30a
AS
150 /**
151 * Payment Processor external order reference
152 *
153 * @var string
154 */
155 public $order_reference;
156
e501603b 157 /**
f41f0342 158 * Class constructor.
e501603b 159 */
c3fc2621 160 public function __construct() {
e501603b
TO
161 $this->__table = 'civicrm_financial_trxn';
162 parent::__construct();
163 }
c3fc2621 164
449c4e6b
CW
165 /**
166 * Returns localized title of this entity.
7b66c3b5
AH
167 *
168 * @param bool $plural
169 * Whether to return the plural version of the title.
449c4e6b 170 */
7b66c3b5
AH
171 public static function getEntityTitle($plural = FALSE) {
172 return $plural ? ts('Financial Trxns') : ts('Financial Trxn');
449c4e6b
CW
173 }
174
e501603b 175 /**
f41f0342 176 * Returns foreign keys and entity references.
e501603b
TO
177 *
178 * @return array
179 * [CRM_Core_Reference_Interface]
180 */
c3fc2621 181 public static function getReferenceColumns() {
346aaaba 182 if (!isset(Civi::$statics[__CLASS__]['links'])) {
fa45b5b9 183 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621
CW
184 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'from_financial_account_id', 'civicrm_financial_account', 'id');
185 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'to_financial_account_id', 'civicrm_financial_account', 'id');
186 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'payment_processor_id', 'civicrm_payment_processor', 'id');
346aaaba 187 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 188 }
346aaaba 189 return Civi::$statics[__CLASS__]['links'];
e501603b 190 }
c3fc2621 191
e501603b
TO
192 /**
193 * Returns all the column names of this table
194 *
195 * @return array
196 */
c3fc2621 197 public static function &fields() {
346aaaba 198 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
199 Civi::$statics[__CLASS__]['fields'] = [
200 'id' => [
e501603b
TO
201 'name' => 'id',
202 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
203 'title' => ts('Financial Transaction ID'),
204 'required' => TRUE,
a36434b9 205 'where' => 'civicrm_financial_trxn.id',
522a26c9 206 'table_name' => 'civicrm_financial_trxn',
207 'entity' => 'FinancialTrxn',
208 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 209 'localizable' => 0,
a9d0587b 210 'add' => '1.3',
c3fc2621
CW
211 ],
212 'from_financial_account_id' => [
e501603b
TO
213 'name' => 'from_financial_account_id',
214 'type' => CRM_Utils_Type::T_INT,
c3fc2621 215 'title' => ts('Financial Transaction From Account'),
215b423e 216 'description' => ts('FK to financial_account table.'),
a36434b9 217 'where' => 'civicrm_financial_trxn.from_financial_account_id',
522a26c9 218 'table_name' => 'civicrm_financial_trxn',
219 'entity' => 'FinancialTrxn',
220 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 221 'localizable' => 0,
e501603b 222 'FKClassName' => 'CRM_Financial_DAO_FinancialAccount',
c3fc2621 223 'html' => [
e501603b 224 'type' => 'Select',
c3fc2621
CW
225 ],
226 'pseudoconstant' => [
e501603b
TO
227 'table' => 'civicrm_financial_account',
228 'keyColumn' => 'id',
229 'labelColumn' => 'name',
e6ca0a57 230 ],
a9d0587b 231 'add' => '4.3',
c3fc2621
CW
232 ],
233 'to_financial_account_id' => [
e501603b
TO
234 'name' => 'to_financial_account_id',
235 'type' => CRM_Utils_Type::T_INT,
c3fc2621 236 'title' => ts('Financial Transaction To Account'),
215b423e 237 'description' => ts('FK to financial_financial_account table.'),
a36434b9 238 'where' => 'civicrm_financial_trxn.to_financial_account_id',
522a26c9 239 'table_name' => 'civicrm_financial_trxn',
240 'entity' => 'FinancialTrxn',
241 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 242 'localizable' => 0,
e501603b 243 'FKClassName' => 'CRM_Financial_DAO_FinancialAccount',
c3fc2621 244 'html' => [
e501603b 245 'type' => 'Select',
c3fc2621
CW
246 ],
247 'pseudoconstant' => [
e501603b
TO
248 'table' => 'civicrm_financial_account',
249 'keyColumn' => 'id',
250 'labelColumn' => 'name',
e6ca0a57 251 ],
a9d0587b 252 'add' => '4.3',
c3fc2621
CW
253 ],
254 'trxn_date' => [
e501603b
TO
255 'name' => 'trxn_date',
256 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
c3fc2621 257 'title' => ts('Financial Transaction Date'),
215b423e 258 'description' => ts('date transaction occurred'),
a36434b9 259 'where' => 'civicrm_financial_trxn.trxn_date',
e501603b 260 'default' => 'NULL',
522a26c9 261 'table_name' => 'civicrm_financial_trxn',
262 'entity' => 'FinancialTrxn',
263 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 264 'localizable' => 0,
c3fc2621 265 'html' => [
f7fb5615 266 'type' => 'Select Date',
267 'formatType' => 'activityDateTime',
c3fc2621 268 ],
a9d0587b 269 'add' => '1.3',
c3fc2621
CW
270 ],
271 'total_amount' => [
e501603b
TO
272 'name' => 'total_amount',
273 'type' => CRM_Utils_Type::T_MONEY,
c3fc2621 274 'title' => ts('Financial Total Amount'),
215b423e 275 'description' => ts('amount of transaction'),
c3fc2621
CW
276 'required' => TRUE,
277 'precision' => [
e501603b 278 20,
fb607354 279 2,
c3fc2621 280 ],
a36434b9 281 'where' => 'civicrm_financial_trxn.total_amount',
522a26c9 282 'table_name' => 'civicrm_financial_trxn',
283 'entity' => 'FinancialTrxn',
284 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 285 'localizable' => 0,
a9d0587b 286 'add' => '1.3',
c3fc2621
CW
287 ],
288 'fee_amount' => [
e501603b
TO
289 'name' => 'fee_amount',
290 'type' => CRM_Utils_Type::T_MONEY,
c3fc2621 291 'title' => ts('Financial Fee Amount'),
215b423e 292 'description' => ts('actual processor fee if known - may be 0.'),
c3fc2621 293 'precision' => [
e501603b 294 20,
fb607354 295 2,
c3fc2621 296 ],
a36434b9 297 'where' => 'civicrm_financial_trxn.fee_amount',
522a26c9 298 'table_name' => 'civicrm_financial_trxn',
299 'entity' => 'FinancialTrxn',
300 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 301 'localizable' => 0,
a9d0587b 302 'add' => '1.3',
c3fc2621
CW
303 ],
304 'net_amount' => [
e501603b
TO
305 'name' => 'net_amount',
306 'type' => CRM_Utils_Type::T_MONEY,
c3fc2621 307 'title' => ts('Financial Net Amount'),
215b423e 308 'description' => ts('actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.'),
c3fc2621 309 'precision' => [
e501603b 310 20,
fb607354 311 2,
c3fc2621 312 ],
a36434b9 313 'where' => 'civicrm_financial_trxn.net_amount',
522a26c9 314 'table_name' => 'civicrm_financial_trxn',
315 'entity' => 'FinancialTrxn',
316 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 317 'localizable' => 0,
a9d0587b 318 'add' => '1.3',
c3fc2621
CW
319 ],
320 'currency' => [
e501603b
TO
321 'name' => 'currency',
322 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 323 'title' => ts('Financial Currency'),
215b423e 324 'description' => ts('3 character string, value from config setting or input via user.'),
e501603b
TO
325 'maxlength' => 3,
326 'size' => CRM_Utils_Type::FOUR,
c3fc2621 327 'import' => TRUE,
e501603b
TO
328 'where' => 'civicrm_financial_trxn.currency',
329 'headerPattern' => '/cur(rency)?/i',
330 'dataPattern' => '/^[A-Z]{3}$/',
c3fc2621 331 'export' => TRUE,
e501603b 332 'default' => 'NULL',
522a26c9 333 'table_name' => 'civicrm_financial_trxn',
334 'entity' => 'FinancialTrxn',
335 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 336 'localizable' => 0,
c3fc2621 337 'html' => [
e501603b 338 'type' => 'Select',
c3fc2621
CW
339 ],
340 'pseudoconstant' => [
e501603b
TO
341 'table' => 'civicrm_currency',
342 'keyColumn' => 'name',
343 'labelColumn' => 'full_name',
344 'nameColumn' => 'name',
a8fdb24e 345 'abbrColumn' => 'symbol',
e6ca0a57 346 ],
a9d0587b 347 'add' => '1.3',
c3fc2621
CW
348 ],
349 'is_payment' => [
e501603b
TO
350 'name' => 'is_payment',
351 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 352 'title' => ts('Is Payment?'),
215b423e 353 'description' => ts('Is this entry either a payment or a reversal of a payment?'),
c3fc2621 354 'import' => TRUE,
e501603b 355 'where' => 'civicrm_financial_trxn.is_payment',
c3fc2621 356 'export' => TRUE,
45a83e42 357 'default' => '0',
522a26c9 358 'table_name' => 'civicrm_financial_trxn',
359 'entity' => 'FinancialTrxn',
360 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 361 'localizable' => 0,
a9d0587b 362 'add' => '4.7',
c3fc2621
CW
363 ],
364 'trxn_id' => [
e501603b
TO
365 'name' => 'trxn_id',
366 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 367 'title' => ts('Transaction ID'),
215b423e 368 'description' => ts('Transaction id supplied by external processor. This may not be unique.'),
e501603b 369 'maxlength' => 255,
a7a8f17d 370 'size' => 10,
a36434b9 371 'where' => 'civicrm_financial_trxn.trxn_id',
522a26c9 372 'table_name' => 'civicrm_financial_trxn',
373 'entity' => 'FinancialTrxn',
374 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 375 'localizable' => 0,
c3fc2621 376 'html' => [
a7a8f17d 377 'type' => 'Text',
c3fc2621 378 ],
a9d0587b 379 'add' => '1.3',
c3fc2621
CW
380 ],
381 'trxn_result_code' => [
e501603b
TO
382 'name' => 'trxn_result_code',
383 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 384 'title' => ts('Transaction Result Code'),
215b423e 385 'description' => ts('processor result code'),
e501603b
TO
386 'maxlength' => 255,
387 'size' => CRM_Utils_Type::HUGE,
a36434b9 388 'where' => 'civicrm_financial_trxn.trxn_result_code',
522a26c9 389 'table_name' => 'civicrm_financial_trxn',
390 'entity' => 'FinancialTrxn',
391 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 392 'localizable' => 0,
a9d0587b 393 'add' => '1.3',
c3fc2621
CW
394 ],
395 'status_id' => [
e501603b
TO
396 'name' => 'status_id',
397 'type' => CRM_Utils_Type::T_INT,
c3fc2621 398 'title' => ts('Financial Transaction Status Id'),
215b423e 399 'description' => ts('pseudo FK to civicrm_option_value of contribution_status_id option_group'),
c3fc2621 400 'import' => TRUE,
e501603b
TO
401 'where' => 'civicrm_financial_trxn.status_id',
402 'headerPattern' => '/status/i',
c3fc2621 403 'export' => TRUE,
522a26c9 404 'table_name' => 'civicrm_financial_trxn',
405 'entity' => 'FinancialTrxn',
406 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 407 'localizable' => 0,
c3fc2621 408 'pseudoconstant' => [
e501603b
TO
409 'optionGroupName' => 'contribution_status',
410 'optionEditPath' => 'civicrm/admin/options/contribution_status',
e6ca0a57 411 ],
a9d0587b 412 'add' => '4.3',
c3fc2621
CW
413 ],
414 'payment_processor_id' => [
e501603b
TO
415 'name' => 'payment_processor_id',
416 'type' => CRM_Utils_Type::T_INT,
c3fc2621 417 'title' => ts('Payment Processor'),
215b423e 418 'description' => ts('Payment Processor for this financial transaction'),
a36434b9 419 'where' => 'civicrm_financial_trxn.payment_processor_id',
522a26c9 420 'table_name' => 'civicrm_financial_trxn',
421 'entity' => 'FinancialTrxn',
422 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 423 'localizable' => 0,
e501603b 424 'FKClassName' => 'CRM_Financial_DAO_PaymentProcessor',
a9d0587b 425 'add' => '4.3',
c3fc2621
CW
426 ],
427 'financial_trxn_payment_instrument_id' => [
e501603b
TO
428 'name' => 'payment_instrument_id',
429 'type' => CRM_Utils_Type::T_INT,
c3fc2621 430 'title' => ts('Payment Method'),
215b423e 431 'description' => ts('FK to payment_instrument option group values'),
a36434b9 432 'where' => 'civicrm_financial_trxn.payment_instrument_id',
522a26c9 433 'table_name' => 'civicrm_financial_trxn',
434 'entity' => 'FinancialTrxn',
435 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 436 'localizable' => 0,
c3fc2621 437 'html' => [
e501603b 438 'type' => 'Select',
c3fc2621
CW
439 ],
440 'pseudoconstant' => [
e501603b
TO
441 'optionGroupName' => 'payment_instrument',
442 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
e6ca0a57 443 ],
a9d0587b 444 'add' => '4.3',
c3fc2621
CW
445 ],
446 'financial_trxn_card_type_id' => [
5e0343e8 447 'name' => 'card_type_id',
ea927522 448 'type' => CRM_Utils_Type::T_INT,
c3fc2621 449 'title' => ts('Card Type ID'),
215b423e 450 'description' => ts('FK to accept_creditcard option group values'),
a36434b9 451 'where' => 'civicrm_financial_trxn.card_type_id',
ea927522
PN
452 'table_name' => 'civicrm_financial_trxn',
453 'entity' => 'FinancialTrxn',
454 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 455 'localizable' => 0,
c3fc2621 456 'html' => [
ea927522 457 'type' => 'Select',
c3fc2621
CW
458 ],
459 'pseudoconstant' => [
ea927522
PN
460 'optionGroupName' => 'accept_creditcard',
461 'optionEditPath' => 'civicrm/admin/options/accept_creditcard',
e6ca0a57 462 ],
a9d0587b 463 'add' => '4.7',
c3fc2621
CW
464 ],
465 'financial_trxn_check_number' => [
e501603b
TO
466 'name' => 'check_number',
467 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 468 'title' => ts('Check Number'),
215b423e 469 'description' => ts('Check number'),
e501603b
TO
470 'maxlength' => 255,
471 'size' => 6,
a36434b9 472 'where' => 'civicrm_financial_trxn.check_number',
522a26c9 473 'table_name' => 'civicrm_financial_trxn',
474 'entity' => 'FinancialTrxn',
475 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 476 'localizable' => 0,
c3fc2621 477 'html' => [
e501603b 478 'type' => 'Text',
c3fc2621 479 ],
a9d0587b 480 'add' => '4.3',
c3fc2621
CW
481 ],
482 'financial_trxn_pan_truncation' => [
ea927522 483 'name' => 'pan_truncation',
4e0ede5a 484 'type' => CRM_Utils_Type::T_STRING,
031f6a5f 485 'title' => ts('PAN Truncation'),
215b423e 486 'description' => ts('Last 4 digits of credit card'),
4e0ede5a
PN
487 'maxlength' => 4,
488 'size' => 4,
a36434b9 489 'where' => 'civicrm_financial_trxn.pan_truncation',
ea927522
PN
490 'table_name' => 'civicrm_financial_trxn',
491 'entity' => 'FinancialTrxn',
492 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
6a7e5e5d 493 'localizable' => 0,
c3fc2621 494 'html' => [
ea927522 495 'type' => 'Text',
c3fc2621 496 ],
a9d0587b 497 'add' => '4.7',
c3fc2621 498 ],
1f34d30a
AS
499 'financial_trxn_order_reference' => [
500 'name' => 'order_reference',
501 'type' => CRM_Utils_Type::T_STRING,
502 'title' => ts('Order Reference'),
503 'description' => ts('Payment Processor external order reference'),
504 'maxlength' => 255,
505 'size' => 25,
506 'where' => 'civicrm_financial_trxn.order_reference',
507 'table_name' => 'civicrm_financial_trxn',
508 'entity' => 'FinancialTrxn',
509 'bao' => 'CRM_Financial_DAO_FinancialTrxn',
510 'localizable' => 0,
511 'html' => [
512 'type' => 'Text',
513 ],
a9d0587b 514 'add' => '5.20',
1f34d30a 515 ],
c3fc2621 516 ];
346aaaba 517 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 518 }
346aaaba 519 return Civi::$statics[__CLASS__]['fields'];
e501603b 520 }
c3fc2621 521
e501603b 522 /**
bd8e0b14 523 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
524 *
525 * @return array
bd8e0b14 526 * Array(string $name => string $uniqueName).
e501603b 527 */
c3fc2621 528 public static function &fieldKeys() {
bd8e0b14
TO
529 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
530 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 531 }
bd8e0b14 532 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 533 }
c3fc2621 534
e501603b
TO
535 /**
536 * Returns the names of this table
537 *
538 * @return string
539 */
c3fc2621 540 public static function getTableName() {
e501603b
TO
541 return self::$_tableName;
542 }
c3fc2621 543
e501603b
TO
544 /**
545 * Returns if this table needs to be logged
546 *
c3fc2621 547 * @return bool
e501603b 548 */
c3fc2621 549 public function getLog() {
e501603b
TO
550 return self::$_log;
551 }
c3fc2621 552
e501603b
TO
553 /**
554 * Returns the list of fields that can be imported
555 *
556 * @param bool $prefix
557 *
558 * @return array
559 */
c3fc2621
CW
560 public static function &import($prefix = FALSE) {
561 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'financial_trxn', $prefix, []);
60808919 562 return $r;
e501603b 563 }
c3fc2621 564
e501603b
TO
565 /**
566 * Returns the list of fields that can be exported
567 *
568 * @param bool $prefix
569 *
570 * @return array
571 */
c3fc2621
CW
572 public static function &export($prefix = FALSE) {
573 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'financial_trxn', $prefix, []);
60808919 574 return $r;
e501603b 575 }
c3fc2621 576
e7a6b91a
AS
577 /**
578 * Returns the list of indices
c3fc2621
CW
579 *
580 * @param bool $localize
581 *
582 * @return array
e7a6b91a
AS
583 */
584 public static function indices($localize = TRUE) {
c3fc2621
CW
585 $indices = [
586 'UI_ftrxn_trxn_id' => [
e7a6b91a 587 'name' => 'UI_ftrxn_trxn_id',
c3fc2621 588 'field' => [
e7a6b91a 589 0 => 'trxn_id',
c3fc2621
CW
590 ],
591 'localizable' => FALSE,
e7a6b91a 592 'sig' => 'civicrm_financial_trxn::0::trxn_id',
c3fc2621
CW
593 ],
594 'UI_ftrxn_payment_instrument_id' => [
e7a6b91a 595 'name' => 'UI_ftrxn_payment_instrument_id',
c3fc2621 596 'field' => [
e7a6b91a 597 0 => 'payment_instrument_id',
c3fc2621
CW
598 ],
599 'localizable' => FALSE,
e7a6b91a 600 'sig' => 'civicrm_financial_trxn::0::payment_instrument_id',
c3fc2621
CW
601 ],
602 'UI_ftrxn_check_number' => [
e7a6b91a 603 'name' => 'UI_ftrxn_check_number',
c3fc2621 604 'field' => [
e7a6b91a 605 0 => 'check_number',
c3fc2621
CW
606 ],
607 'localizable' => FALSE,
e7a6b91a 608 'sig' => 'civicrm_financial_trxn::0::check_number',
c3fc2621
CW
609 ],
610 ];
e7a6b91a
AS
611 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
612 }
c3fc2621 613
e501603b 614}