Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
6b83d5bd | 5 | * @copyright CiviCRM LLC (c) 2004-2019 |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Financial/FinancialTrxn.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
fb607354 | 9 | * (GenCodeChecksum:e130935b88e96b99dc58cb9003666e18) |
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 | |
e501603b | 148 | /** |
f41f0342 | 149 | * Class constructor. |
e501603b | 150 | */ |
c3fc2621 | 151 | public function __construct() { |
e501603b TO |
152 | $this->__table = 'civicrm_financial_trxn'; |
153 | parent::__construct(); | |
154 | } | |
c3fc2621 | 155 | |
e501603b | 156 | /** |
f41f0342 | 157 | * Returns foreign keys and entity references. |
e501603b TO |
158 | * |
159 | * @return array | |
160 | * [CRM_Core_Reference_Interface] | |
161 | */ | |
c3fc2621 | 162 | public static function getReferenceColumns() { |
346aaaba | 163 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
fa45b5b9 | 164 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 CW |
165 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'from_financial_account_id', 'civicrm_financial_account', 'id'); |
166 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'to_financial_account_id', 'civicrm_financial_account', 'id'); | |
167 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'payment_processor_id', 'civicrm_payment_processor', 'id'); | |
346aaaba | 168 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 169 | } |
346aaaba | 170 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 171 | } |
c3fc2621 | 172 | |
e501603b TO |
173 | /** |
174 | * Returns all the column names of this table | |
175 | * | |
176 | * @return array | |
177 | */ | |
c3fc2621 | 178 | public static function &fields() { |
346aaaba | 179 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
180 | Civi::$statics[__CLASS__]['fields'] = [ |
181 | 'id' => [ | |
e501603b TO |
182 | 'name' => 'id', |
183 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 CW |
184 | 'title' => ts('Financial Transaction ID'), |
185 | 'required' => TRUE, | |
a36434b9 | 186 | 'where' => 'civicrm_financial_trxn.id', |
522a26c9 | 187 | 'table_name' => 'civicrm_financial_trxn', |
188 | 'entity' => 'FinancialTrxn', | |
189 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 190 | 'localizable' => 0, |
c3fc2621 CW |
191 | ], |
192 | 'from_financial_account_id' => [ | |
e501603b TO |
193 | 'name' => 'from_financial_account_id', |
194 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 195 | 'title' => ts('Financial Transaction From Account'), |
215b423e | 196 | 'description' => ts('FK to financial_account table.'), |
a36434b9 | 197 | 'where' => 'civicrm_financial_trxn.from_financial_account_id', |
522a26c9 | 198 | 'table_name' => 'civicrm_financial_trxn', |
199 | 'entity' => 'FinancialTrxn', | |
200 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 201 | 'localizable' => 0, |
e501603b | 202 | 'FKClassName' => 'CRM_Financial_DAO_FinancialAccount', |
c3fc2621 | 203 | 'html' => [ |
e501603b | 204 | 'type' => 'Select', |
c3fc2621 CW |
205 | ], |
206 | 'pseudoconstant' => [ | |
e501603b TO |
207 | 'table' => 'civicrm_financial_account', |
208 | 'keyColumn' => 'id', | |
209 | 'labelColumn' => 'name', | |
e6ca0a57 | 210 | ], |
c3fc2621 CW |
211 | ], |
212 | 'to_financial_account_id' => [ | |
e501603b TO |
213 | 'name' => 'to_financial_account_id', |
214 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 215 | 'title' => ts('Financial Transaction To Account'), |
215b423e | 216 | 'description' => ts('FK to financial_financial_account table.'), |
a36434b9 | 217 | 'where' => 'civicrm_financial_trxn.to_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 | ], |
c3fc2621 CW |
231 | ], |
232 | 'trxn_date' => [ | |
e501603b TO |
233 | 'name' => 'trxn_date', |
234 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
c3fc2621 | 235 | 'title' => ts('Financial Transaction Date'), |
215b423e | 236 | 'description' => ts('date transaction occurred'), |
a36434b9 | 237 | 'where' => 'civicrm_financial_trxn.trxn_date', |
e501603b | 238 | 'default' => 'NULL', |
522a26c9 | 239 | 'table_name' => 'civicrm_financial_trxn', |
240 | 'entity' => 'FinancialTrxn', | |
241 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 242 | 'localizable' => 0, |
c3fc2621 | 243 | 'html' => [ |
f7fb5615 | 244 | 'type' => 'Select Date', |
245 | 'formatType' => 'activityDateTime', | |
c3fc2621 CW |
246 | ], |
247 | ], | |
248 | 'total_amount' => [ | |
e501603b TO |
249 | 'name' => 'total_amount', |
250 | 'type' => CRM_Utils_Type::T_MONEY, | |
c3fc2621 | 251 | 'title' => ts('Financial Total Amount'), |
215b423e | 252 | 'description' => ts('amount of transaction'), |
c3fc2621 CW |
253 | 'required' => TRUE, |
254 | 'precision' => [ | |
e501603b | 255 | 20, |
fb607354 | 256 | 2, |
c3fc2621 | 257 | ], |
a36434b9 | 258 | 'where' => 'civicrm_financial_trxn.total_amount', |
522a26c9 | 259 | 'table_name' => 'civicrm_financial_trxn', |
260 | 'entity' => 'FinancialTrxn', | |
261 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 262 | 'localizable' => 0, |
c3fc2621 CW |
263 | ], |
264 | 'fee_amount' => [ | |
e501603b TO |
265 | 'name' => 'fee_amount', |
266 | 'type' => CRM_Utils_Type::T_MONEY, | |
c3fc2621 | 267 | 'title' => ts('Financial Fee Amount'), |
215b423e | 268 | 'description' => ts('actual processor fee if known - may be 0.'), |
c3fc2621 | 269 | 'precision' => [ |
e501603b | 270 | 20, |
fb607354 | 271 | 2, |
c3fc2621 | 272 | ], |
a36434b9 | 273 | 'where' => 'civicrm_financial_trxn.fee_amount', |
522a26c9 | 274 | 'table_name' => 'civicrm_financial_trxn', |
275 | 'entity' => 'FinancialTrxn', | |
276 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 277 | 'localizable' => 0, |
c3fc2621 CW |
278 | ], |
279 | 'net_amount' => [ | |
e501603b TO |
280 | 'name' => 'net_amount', |
281 | 'type' => CRM_Utils_Type::T_MONEY, | |
c3fc2621 | 282 | 'title' => ts('Financial Net Amount'), |
215b423e | 283 | '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 | 284 | 'precision' => [ |
e501603b | 285 | 20, |
fb607354 | 286 | 2, |
c3fc2621 | 287 | ], |
a36434b9 | 288 | 'where' => 'civicrm_financial_trxn.net_amount', |
522a26c9 | 289 | 'table_name' => 'civicrm_financial_trxn', |
290 | 'entity' => 'FinancialTrxn', | |
291 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 292 | 'localizable' => 0, |
c3fc2621 CW |
293 | ], |
294 | 'currency' => [ | |
e501603b TO |
295 | 'name' => 'currency', |
296 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 297 | 'title' => ts('Financial Currency'), |
215b423e | 298 | 'description' => ts('3 character string, value from config setting or input via user.'), |
e501603b TO |
299 | 'maxlength' => 3, |
300 | 'size' => CRM_Utils_Type::FOUR, | |
c3fc2621 | 301 | 'import' => TRUE, |
e501603b TO |
302 | 'where' => 'civicrm_financial_trxn.currency', |
303 | 'headerPattern' => '/cur(rency)?/i', | |
304 | 'dataPattern' => '/^[A-Z]{3}$/', | |
c3fc2621 | 305 | 'export' => TRUE, |
e501603b | 306 | 'default' => 'NULL', |
522a26c9 | 307 | 'table_name' => 'civicrm_financial_trxn', |
308 | 'entity' => 'FinancialTrxn', | |
309 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 310 | 'localizable' => 0, |
c3fc2621 | 311 | 'html' => [ |
e501603b | 312 | 'type' => 'Select', |
c3fc2621 CW |
313 | ], |
314 | 'pseudoconstant' => [ | |
e501603b TO |
315 | 'table' => 'civicrm_currency', |
316 | 'keyColumn' => 'name', | |
317 | 'labelColumn' => 'full_name', | |
318 | 'nameColumn' => 'name', | |
e6ca0a57 | 319 | ], |
c3fc2621 CW |
320 | ], |
321 | 'is_payment' => [ | |
e501603b TO |
322 | 'name' => 'is_payment', |
323 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 324 | 'title' => ts('Is Payment?'), |
215b423e | 325 | 'description' => ts('Is this entry either a payment or a reversal of a payment?'), |
c3fc2621 | 326 | 'import' => TRUE, |
e501603b | 327 | 'where' => 'civicrm_financial_trxn.is_payment', |
c3fc2621 | 328 | 'export' => TRUE, |
45a83e42 | 329 | 'default' => '0', |
522a26c9 | 330 | 'table_name' => 'civicrm_financial_trxn', |
331 | 'entity' => 'FinancialTrxn', | |
332 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 333 | 'localizable' => 0, |
c3fc2621 CW |
334 | ], |
335 | 'trxn_id' => [ | |
e501603b TO |
336 | 'name' => 'trxn_id', |
337 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 338 | 'title' => ts('Transaction ID'), |
215b423e | 339 | 'description' => ts('Transaction id supplied by external processor. This may not be unique.'), |
e501603b | 340 | 'maxlength' => 255, |
a7a8f17d | 341 | 'size' => 10, |
a36434b9 | 342 | 'where' => 'civicrm_financial_trxn.trxn_id', |
522a26c9 | 343 | 'table_name' => 'civicrm_financial_trxn', |
344 | 'entity' => 'FinancialTrxn', | |
345 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 346 | 'localizable' => 0, |
c3fc2621 | 347 | 'html' => [ |
a7a8f17d | 348 | 'type' => 'Text', |
c3fc2621 CW |
349 | ], |
350 | ], | |
351 | 'trxn_result_code' => [ | |
e501603b TO |
352 | 'name' => 'trxn_result_code', |
353 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 354 | 'title' => ts('Transaction Result Code'), |
215b423e | 355 | 'description' => ts('processor result code'), |
e501603b TO |
356 | 'maxlength' => 255, |
357 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 358 | 'where' => 'civicrm_financial_trxn.trxn_result_code', |
522a26c9 | 359 | 'table_name' => 'civicrm_financial_trxn', |
360 | 'entity' => 'FinancialTrxn', | |
361 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 362 | 'localizable' => 0, |
c3fc2621 CW |
363 | ], |
364 | 'status_id' => [ | |
e501603b TO |
365 | 'name' => 'status_id', |
366 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 367 | 'title' => ts('Financial Transaction Status Id'), |
215b423e | 368 | 'description' => ts('pseudo FK to civicrm_option_value of contribution_status_id option_group'), |
c3fc2621 | 369 | 'import' => TRUE, |
e501603b TO |
370 | 'where' => 'civicrm_financial_trxn.status_id', |
371 | 'headerPattern' => '/status/i', | |
c3fc2621 | 372 | 'export' => TRUE, |
522a26c9 | 373 | 'table_name' => 'civicrm_financial_trxn', |
374 | 'entity' => 'FinancialTrxn', | |
375 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 376 | 'localizable' => 0, |
c3fc2621 | 377 | 'pseudoconstant' => [ |
e501603b TO |
378 | 'optionGroupName' => 'contribution_status', |
379 | 'optionEditPath' => 'civicrm/admin/options/contribution_status', | |
e6ca0a57 | 380 | ], |
c3fc2621 CW |
381 | ], |
382 | 'payment_processor_id' => [ | |
e501603b TO |
383 | 'name' => 'payment_processor_id', |
384 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 385 | 'title' => ts('Payment Processor'), |
215b423e | 386 | 'description' => ts('Payment Processor for this financial transaction'), |
a36434b9 | 387 | 'where' => 'civicrm_financial_trxn.payment_processor_id', |
522a26c9 | 388 | 'table_name' => 'civicrm_financial_trxn', |
389 | 'entity' => 'FinancialTrxn', | |
390 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 391 | 'localizable' => 0, |
e501603b | 392 | 'FKClassName' => 'CRM_Financial_DAO_PaymentProcessor', |
c3fc2621 CW |
393 | ], |
394 | 'financial_trxn_payment_instrument_id' => [ | |
e501603b TO |
395 | 'name' => 'payment_instrument_id', |
396 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 397 | 'title' => ts('Payment Method'), |
215b423e | 398 | 'description' => ts('FK to payment_instrument option group values'), |
a36434b9 | 399 | 'where' => 'civicrm_financial_trxn.payment_instrument_id', |
522a26c9 | 400 | 'table_name' => 'civicrm_financial_trxn', |
401 | 'entity' => 'FinancialTrxn', | |
402 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 403 | 'localizable' => 0, |
c3fc2621 | 404 | 'html' => [ |
e501603b | 405 | 'type' => 'Select', |
c3fc2621 CW |
406 | ], |
407 | 'pseudoconstant' => [ | |
e501603b TO |
408 | 'optionGroupName' => 'payment_instrument', |
409 | 'optionEditPath' => 'civicrm/admin/options/payment_instrument', | |
e6ca0a57 | 410 | ], |
c3fc2621 CW |
411 | ], |
412 | 'financial_trxn_card_type_id' => [ | |
5e0343e8 | 413 | 'name' => 'card_type_id', |
ea927522 | 414 | 'type' => CRM_Utils_Type::T_INT, |
c3fc2621 | 415 | 'title' => ts('Card Type ID'), |
215b423e | 416 | 'description' => ts('FK to accept_creditcard option group values'), |
a36434b9 | 417 | 'where' => 'civicrm_financial_trxn.card_type_id', |
ea927522 PN |
418 | 'table_name' => 'civicrm_financial_trxn', |
419 | 'entity' => 'FinancialTrxn', | |
420 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 421 | 'localizable' => 0, |
c3fc2621 | 422 | 'html' => [ |
ea927522 | 423 | 'type' => 'Select', |
c3fc2621 CW |
424 | ], |
425 | 'pseudoconstant' => [ | |
ea927522 PN |
426 | 'optionGroupName' => 'accept_creditcard', |
427 | 'optionEditPath' => 'civicrm/admin/options/accept_creditcard', | |
e6ca0a57 | 428 | ], |
c3fc2621 CW |
429 | ], |
430 | 'financial_trxn_check_number' => [ | |
e501603b TO |
431 | 'name' => 'check_number', |
432 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 433 | 'title' => ts('Check Number'), |
215b423e | 434 | 'description' => ts('Check number'), |
e501603b TO |
435 | 'maxlength' => 255, |
436 | 'size' => 6, | |
a36434b9 | 437 | 'where' => 'civicrm_financial_trxn.check_number', |
522a26c9 | 438 | 'table_name' => 'civicrm_financial_trxn', |
439 | 'entity' => 'FinancialTrxn', | |
440 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 441 | 'localizable' => 0, |
c3fc2621 | 442 | 'html' => [ |
e501603b | 443 | 'type' => 'Text', |
c3fc2621 CW |
444 | ], |
445 | ], | |
446 | 'financial_trxn_pan_truncation' => [ | |
ea927522 | 447 | 'name' => 'pan_truncation', |
4e0ede5a | 448 | 'type' => CRM_Utils_Type::T_STRING, |
c3fc2621 | 449 | 'title' => ts('Pan Truncation'), |
215b423e | 450 | 'description' => ts('Last 4 digits of credit card'), |
4e0ede5a PN |
451 | 'maxlength' => 4, |
452 | 'size' => 4, | |
a36434b9 | 453 | 'where' => 'civicrm_financial_trxn.pan_truncation', |
ea927522 PN |
454 | 'table_name' => 'civicrm_financial_trxn', |
455 | 'entity' => 'FinancialTrxn', | |
456 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 457 | 'localizable' => 0, |
c3fc2621 | 458 | 'html' => [ |
ea927522 | 459 | 'type' => 'Text', |
c3fc2621 CW |
460 | ], |
461 | ], | |
462 | ]; | |
346aaaba | 463 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 464 | } |
346aaaba | 465 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 466 | } |
c3fc2621 | 467 | |
e501603b | 468 | /** |
bd8e0b14 | 469 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
470 | * |
471 | * @return array | |
bd8e0b14 | 472 | * Array(string $name => string $uniqueName). |
e501603b | 473 | */ |
c3fc2621 | 474 | public static function &fieldKeys() { |
bd8e0b14 TO |
475 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
476 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 477 | } |
bd8e0b14 | 478 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 479 | } |
c3fc2621 | 480 | |
e501603b TO |
481 | /** |
482 | * Returns the names of this table | |
483 | * | |
484 | * @return string | |
485 | */ | |
c3fc2621 | 486 | public static function getTableName() { |
e501603b TO |
487 | return self::$_tableName; |
488 | } | |
c3fc2621 | 489 | |
e501603b TO |
490 | /** |
491 | * Returns if this table needs to be logged | |
492 | * | |
c3fc2621 | 493 | * @return bool |
e501603b | 494 | */ |
c3fc2621 | 495 | public function getLog() { |
e501603b TO |
496 | return self::$_log; |
497 | } | |
c3fc2621 | 498 | |
e501603b TO |
499 | /** |
500 | * Returns the list of fields that can be imported | |
501 | * | |
502 | * @param bool $prefix | |
503 | * | |
504 | * @return array | |
505 | */ | |
c3fc2621 CW |
506 | public static function &import($prefix = FALSE) { |
507 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'financial_trxn', $prefix, []); | |
60808919 | 508 | return $r; |
e501603b | 509 | } |
c3fc2621 | 510 | |
e501603b TO |
511 | /** |
512 | * Returns the list of fields that can be exported | |
513 | * | |
514 | * @param bool $prefix | |
515 | * | |
516 | * @return array | |
517 | */ | |
c3fc2621 CW |
518 | public static function &export($prefix = FALSE) { |
519 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'financial_trxn', $prefix, []); | |
60808919 | 520 | return $r; |
e501603b | 521 | } |
c3fc2621 | 522 | |
e7a6b91a AS |
523 | /** |
524 | * Returns the list of indices | |
c3fc2621 CW |
525 | * |
526 | * @param bool $localize | |
527 | * | |
528 | * @return array | |
e7a6b91a AS |
529 | */ |
530 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
531 | $indices = [ |
532 | 'UI_ftrxn_trxn_id' => [ | |
e7a6b91a | 533 | 'name' => 'UI_ftrxn_trxn_id', |
c3fc2621 | 534 | 'field' => [ |
e7a6b91a | 535 | 0 => 'trxn_id', |
c3fc2621 CW |
536 | ], |
537 | 'localizable' => FALSE, | |
e7a6b91a | 538 | 'sig' => 'civicrm_financial_trxn::0::trxn_id', |
c3fc2621 CW |
539 | ], |
540 | 'UI_ftrxn_payment_instrument_id' => [ | |
e7a6b91a | 541 | 'name' => 'UI_ftrxn_payment_instrument_id', |
c3fc2621 | 542 | 'field' => [ |
e7a6b91a | 543 | 0 => 'payment_instrument_id', |
c3fc2621 CW |
544 | ], |
545 | 'localizable' => FALSE, | |
e7a6b91a | 546 | 'sig' => 'civicrm_financial_trxn::0::payment_instrument_id', |
c3fc2621 CW |
547 | ], |
548 | 'UI_ftrxn_check_number' => [ | |
e7a6b91a | 549 | 'name' => 'UI_ftrxn_check_number', |
c3fc2621 | 550 | 'field' => [ |
e7a6b91a | 551 | 0 => 'check_number', |
c3fc2621 CW |
552 | ], |
553 | 'localizable' => FALSE, | |
e7a6b91a | 554 | 'sig' => 'civicrm_financial_trxn::0::check_number', |
c3fc2621 CW |
555 | ], |
556 | ]; | |
e7a6b91a AS |
557 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
558 | } | |
c3fc2621 | 559 | |
e501603b | 560 | } |