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