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 | |
a9d0587b | 9 | * (GenCodeChecksum:7e2cf7d374cc6e0af61672c0318248b6) |
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, |
a9d0587b | 205 | 'add' => '1.3', |
c3fc2621 CW |
206 | ], |
207 | 'from_financial_account_id' => [ | |
e501603b TO |
208 | 'name' => 'from_financial_account_id', |
209 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 210 | 'title' => ts('Financial Transaction From Account'), |
215b423e | 211 | 'description' => ts('FK to financial_account table.'), |
a36434b9 | 212 | 'where' => 'civicrm_financial_trxn.from_financial_account_id', |
522a26c9 | 213 | 'table_name' => 'civicrm_financial_trxn', |
214 | 'entity' => 'FinancialTrxn', | |
215 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 216 | 'localizable' => 0, |
e501603b | 217 | 'FKClassName' => 'CRM_Financial_DAO_FinancialAccount', |
c3fc2621 | 218 | 'html' => [ |
e501603b | 219 | 'type' => 'Select', |
c3fc2621 CW |
220 | ], |
221 | 'pseudoconstant' => [ | |
e501603b TO |
222 | 'table' => 'civicrm_financial_account', |
223 | 'keyColumn' => 'id', | |
224 | 'labelColumn' => 'name', | |
e6ca0a57 | 225 | ], |
a9d0587b | 226 | 'add' => '4.3', |
c3fc2621 CW |
227 | ], |
228 | 'to_financial_account_id' => [ | |
e501603b TO |
229 | 'name' => 'to_financial_account_id', |
230 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 231 | 'title' => ts('Financial Transaction To Account'), |
215b423e | 232 | 'description' => ts('FK to financial_financial_account table.'), |
a36434b9 | 233 | 'where' => 'civicrm_financial_trxn.to_financial_account_id', |
522a26c9 | 234 | 'table_name' => 'civicrm_financial_trxn', |
235 | 'entity' => 'FinancialTrxn', | |
236 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 237 | 'localizable' => 0, |
e501603b | 238 | 'FKClassName' => 'CRM_Financial_DAO_FinancialAccount', |
c3fc2621 | 239 | 'html' => [ |
e501603b | 240 | 'type' => 'Select', |
c3fc2621 CW |
241 | ], |
242 | 'pseudoconstant' => [ | |
e501603b TO |
243 | 'table' => 'civicrm_financial_account', |
244 | 'keyColumn' => 'id', | |
245 | 'labelColumn' => 'name', | |
e6ca0a57 | 246 | ], |
a9d0587b | 247 | 'add' => '4.3', |
c3fc2621 CW |
248 | ], |
249 | 'trxn_date' => [ | |
e501603b TO |
250 | 'name' => 'trxn_date', |
251 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
c3fc2621 | 252 | 'title' => ts('Financial Transaction Date'), |
215b423e | 253 | 'description' => ts('date transaction occurred'), |
a36434b9 | 254 | 'where' => 'civicrm_financial_trxn.trxn_date', |
e501603b | 255 | 'default' => 'NULL', |
522a26c9 | 256 | 'table_name' => 'civicrm_financial_trxn', |
257 | 'entity' => 'FinancialTrxn', | |
258 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 259 | 'localizable' => 0, |
c3fc2621 | 260 | 'html' => [ |
f7fb5615 | 261 | 'type' => 'Select Date', |
262 | 'formatType' => 'activityDateTime', | |
c3fc2621 | 263 | ], |
a9d0587b | 264 | 'add' => '1.3', |
c3fc2621 CW |
265 | ], |
266 | 'total_amount' => [ | |
e501603b TO |
267 | 'name' => 'total_amount', |
268 | 'type' => CRM_Utils_Type::T_MONEY, | |
c3fc2621 | 269 | 'title' => ts('Financial Total Amount'), |
215b423e | 270 | 'description' => ts('amount of transaction'), |
c3fc2621 CW |
271 | 'required' => TRUE, |
272 | 'precision' => [ | |
e501603b | 273 | 20, |
fb607354 | 274 | 2, |
c3fc2621 | 275 | ], |
a36434b9 | 276 | 'where' => 'civicrm_financial_trxn.total_amount', |
522a26c9 | 277 | 'table_name' => 'civicrm_financial_trxn', |
278 | 'entity' => 'FinancialTrxn', | |
279 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 280 | 'localizable' => 0, |
a9d0587b | 281 | 'add' => '1.3', |
c3fc2621 CW |
282 | ], |
283 | 'fee_amount' => [ | |
e501603b TO |
284 | 'name' => 'fee_amount', |
285 | 'type' => CRM_Utils_Type::T_MONEY, | |
c3fc2621 | 286 | 'title' => ts('Financial Fee Amount'), |
215b423e | 287 | 'description' => ts('actual processor fee if known - may be 0.'), |
c3fc2621 | 288 | 'precision' => [ |
e501603b | 289 | 20, |
fb607354 | 290 | 2, |
c3fc2621 | 291 | ], |
a36434b9 | 292 | 'where' => 'civicrm_financial_trxn.fee_amount', |
522a26c9 | 293 | 'table_name' => 'civicrm_financial_trxn', |
294 | 'entity' => 'FinancialTrxn', | |
295 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 296 | 'localizable' => 0, |
a9d0587b | 297 | 'add' => '1.3', |
c3fc2621 CW |
298 | ], |
299 | 'net_amount' => [ | |
e501603b TO |
300 | 'name' => 'net_amount', |
301 | 'type' => CRM_Utils_Type::T_MONEY, | |
c3fc2621 | 302 | 'title' => ts('Financial Net Amount'), |
215b423e | 303 | '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 | 304 | 'precision' => [ |
e501603b | 305 | 20, |
fb607354 | 306 | 2, |
c3fc2621 | 307 | ], |
a36434b9 | 308 | 'where' => 'civicrm_financial_trxn.net_amount', |
522a26c9 | 309 | 'table_name' => 'civicrm_financial_trxn', |
310 | 'entity' => 'FinancialTrxn', | |
311 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 312 | 'localizable' => 0, |
a9d0587b | 313 | 'add' => '1.3', |
c3fc2621 CW |
314 | ], |
315 | 'currency' => [ | |
e501603b TO |
316 | 'name' => 'currency', |
317 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 318 | 'title' => ts('Financial Currency'), |
215b423e | 319 | 'description' => ts('3 character string, value from config setting or input via user.'), |
e501603b TO |
320 | 'maxlength' => 3, |
321 | 'size' => CRM_Utils_Type::FOUR, | |
c3fc2621 | 322 | 'import' => TRUE, |
e501603b TO |
323 | 'where' => 'civicrm_financial_trxn.currency', |
324 | 'headerPattern' => '/cur(rency)?/i', | |
325 | 'dataPattern' => '/^[A-Z]{3}$/', | |
c3fc2621 | 326 | 'export' => TRUE, |
e501603b | 327 | 'default' => 'NULL', |
522a26c9 | 328 | 'table_name' => 'civicrm_financial_trxn', |
329 | 'entity' => 'FinancialTrxn', | |
330 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 331 | 'localizable' => 0, |
c3fc2621 | 332 | 'html' => [ |
e501603b | 333 | 'type' => 'Select', |
c3fc2621 CW |
334 | ], |
335 | 'pseudoconstant' => [ | |
e501603b TO |
336 | 'table' => 'civicrm_currency', |
337 | 'keyColumn' => 'name', | |
338 | 'labelColumn' => 'full_name', | |
339 | 'nameColumn' => 'name', | |
a8fdb24e | 340 | 'abbrColumn' => 'symbol', |
e6ca0a57 | 341 | ], |
a9d0587b | 342 | 'add' => '1.3', |
c3fc2621 CW |
343 | ], |
344 | 'is_payment' => [ | |
e501603b TO |
345 | 'name' => 'is_payment', |
346 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 347 | 'title' => ts('Is Payment?'), |
215b423e | 348 | 'description' => ts('Is this entry either a payment or a reversal of a payment?'), |
c3fc2621 | 349 | 'import' => TRUE, |
e501603b | 350 | 'where' => 'civicrm_financial_trxn.is_payment', |
c3fc2621 | 351 | 'export' => TRUE, |
45a83e42 | 352 | 'default' => '0', |
522a26c9 | 353 | 'table_name' => 'civicrm_financial_trxn', |
354 | 'entity' => 'FinancialTrxn', | |
355 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 356 | 'localizable' => 0, |
a9d0587b | 357 | 'add' => '4.7', |
c3fc2621 CW |
358 | ], |
359 | 'trxn_id' => [ | |
e501603b TO |
360 | 'name' => 'trxn_id', |
361 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 362 | 'title' => ts('Transaction ID'), |
215b423e | 363 | 'description' => ts('Transaction id supplied by external processor. This may not be unique.'), |
e501603b | 364 | 'maxlength' => 255, |
a7a8f17d | 365 | 'size' => 10, |
a36434b9 | 366 | 'where' => 'civicrm_financial_trxn.trxn_id', |
522a26c9 | 367 | 'table_name' => 'civicrm_financial_trxn', |
368 | 'entity' => 'FinancialTrxn', | |
369 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 370 | 'localizable' => 0, |
c3fc2621 | 371 | 'html' => [ |
a7a8f17d | 372 | 'type' => 'Text', |
c3fc2621 | 373 | ], |
a9d0587b | 374 | 'add' => '1.3', |
c3fc2621 CW |
375 | ], |
376 | 'trxn_result_code' => [ | |
e501603b TO |
377 | 'name' => 'trxn_result_code', |
378 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 379 | 'title' => ts('Transaction Result Code'), |
215b423e | 380 | 'description' => ts('processor result code'), |
e501603b TO |
381 | 'maxlength' => 255, |
382 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 383 | 'where' => 'civicrm_financial_trxn.trxn_result_code', |
522a26c9 | 384 | 'table_name' => 'civicrm_financial_trxn', |
385 | 'entity' => 'FinancialTrxn', | |
386 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 387 | 'localizable' => 0, |
a9d0587b | 388 | 'add' => '1.3', |
c3fc2621 CW |
389 | ], |
390 | 'status_id' => [ | |
e501603b TO |
391 | 'name' => 'status_id', |
392 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 393 | 'title' => ts('Financial Transaction Status Id'), |
215b423e | 394 | 'description' => ts('pseudo FK to civicrm_option_value of contribution_status_id option_group'), |
c3fc2621 | 395 | 'import' => TRUE, |
e501603b TO |
396 | 'where' => 'civicrm_financial_trxn.status_id', |
397 | 'headerPattern' => '/status/i', | |
c3fc2621 | 398 | 'export' => TRUE, |
522a26c9 | 399 | 'table_name' => 'civicrm_financial_trxn', |
400 | 'entity' => 'FinancialTrxn', | |
401 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 402 | 'localizable' => 0, |
c3fc2621 | 403 | 'pseudoconstant' => [ |
e501603b TO |
404 | 'optionGroupName' => 'contribution_status', |
405 | 'optionEditPath' => 'civicrm/admin/options/contribution_status', | |
e6ca0a57 | 406 | ], |
a9d0587b | 407 | 'add' => '4.3', |
c3fc2621 CW |
408 | ], |
409 | 'payment_processor_id' => [ | |
e501603b TO |
410 | 'name' => 'payment_processor_id', |
411 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 412 | 'title' => ts('Payment Processor'), |
215b423e | 413 | 'description' => ts('Payment Processor for this financial transaction'), |
a36434b9 | 414 | 'where' => 'civicrm_financial_trxn.payment_processor_id', |
522a26c9 | 415 | 'table_name' => 'civicrm_financial_trxn', |
416 | 'entity' => 'FinancialTrxn', | |
417 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 418 | 'localizable' => 0, |
e501603b | 419 | 'FKClassName' => 'CRM_Financial_DAO_PaymentProcessor', |
a9d0587b | 420 | 'add' => '4.3', |
c3fc2621 CW |
421 | ], |
422 | 'financial_trxn_payment_instrument_id' => [ | |
e501603b TO |
423 | 'name' => 'payment_instrument_id', |
424 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 425 | 'title' => ts('Payment Method'), |
215b423e | 426 | 'description' => ts('FK to payment_instrument option group values'), |
a36434b9 | 427 | 'where' => 'civicrm_financial_trxn.payment_instrument_id', |
522a26c9 | 428 | 'table_name' => 'civicrm_financial_trxn', |
429 | 'entity' => 'FinancialTrxn', | |
430 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 431 | 'localizable' => 0, |
c3fc2621 | 432 | 'html' => [ |
e501603b | 433 | 'type' => 'Select', |
c3fc2621 CW |
434 | ], |
435 | 'pseudoconstant' => [ | |
e501603b TO |
436 | 'optionGroupName' => 'payment_instrument', |
437 | 'optionEditPath' => 'civicrm/admin/options/payment_instrument', | |
e6ca0a57 | 438 | ], |
a9d0587b | 439 | 'add' => '4.3', |
c3fc2621 CW |
440 | ], |
441 | 'financial_trxn_card_type_id' => [ | |
5e0343e8 | 442 | 'name' => 'card_type_id', |
ea927522 | 443 | 'type' => CRM_Utils_Type::T_INT, |
c3fc2621 | 444 | 'title' => ts('Card Type ID'), |
215b423e | 445 | 'description' => ts('FK to accept_creditcard option group values'), |
a36434b9 | 446 | 'where' => 'civicrm_financial_trxn.card_type_id', |
ea927522 PN |
447 | 'table_name' => 'civicrm_financial_trxn', |
448 | 'entity' => 'FinancialTrxn', | |
449 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 450 | 'localizable' => 0, |
c3fc2621 | 451 | 'html' => [ |
ea927522 | 452 | 'type' => 'Select', |
c3fc2621 CW |
453 | ], |
454 | 'pseudoconstant' => [ | |
ea927522 PN |
455 | 'optionGroupName' => 'accept_creditcard', |
456 | 'optionEditPath' => 'civicrm/admin/options/accept_creditcard', | |
e6ca0a57 | 457 | ], |
a9d0587b | 458 | 'add' => '4.7', |
c3fc2621 CW |
459 | ], |
460 | 'financial_trxn_check_number' => [ | |
e501603b TO |
461 | 'name' => 'check_number', |
462 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 463 | 'title' => ts('Check Number'), |
215b423e | 464 | 'description' => ts('Check number'), |
e501603b TO |
465 | 'maxlength' => 255, |
466 | 'size' => 6, | |
a36434b9 | 467 | 'where' => 'civicrm_financial_trxn.check_number', |
522a26c9 | 468 | 'table_name' => 'civicrm_financial_trxn', |
469 | 'entity' => 'FinancialTrxn', | |
470 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 471 | 'localizable' => 0, |
c3fc2621 | 472 | 'html' => [ |
e501603b | 473 | 'type' => 'Text', |
c3fc2621 | 474 | ], |
a9d0587b | 475 | 'add' => '4.3', |
c3fc2621 CW |
476 | ], |
477 | 'financial_trxn_pan_truncation' => [ | |
ea927522 | 478 | 'name' => 'pan_truncation', |
4e0ede5a | 479 | 'type' => CRM_Utils_Type::T_STRING, |
031f6a5f | 480 | 'title' => ts('PAN Truncation'), |
215b423e | 481 | 'description' => ts('Last 4 digits of credit card'), |
4e0ede5a PN |
482 | 'maxlength' => 4, |
483 | 'size' => 4, | |
a36434b9 | 484 | 'where' => 'civicrm_financial_trxn.pan_truncation', |
ea927522 PN |
485 | 'table_name' => 'civicrm_financial_trxn', |
486 | 'entity' => 'FinancialTrxn', | |
487 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
6a7e5e5d | 488 | 'localizable' => 0, |
c3fc2621 | 489 | 'html' => [ |
ea927522 | 490 | 'type' => 'Text', |
c3fc2621 | 491 | ], |
a9d0587b | 492 | 'add' => '4.7', |
c3fc2621 | 493 | ], |
1f34d30a AS |
494 | 'financial_trxn_order_reference' => [ |
495 | 'name' => 'order_reference', | |
496 | 'type' => CRM_Utils_Type::T_STRING, | |
497 | 'title' => ts('Order Reference'), | |
498 | 'description' => ts('Payment Processor external order reference'), | |
499 | 'maxlength' => 255, | |
500 | 'size' => 25, | |
501 | 'where' => 'civicrm_financial_trxn.order_reference', | |
502 | 'table_name' => 'civicrm_financial_trxn', | |
503 | 'entity' => 'FinancialTrxn', | |
504 | 'bao' => 'CRM_Financial_DAO_FinancialTrxn', | |
505 | 'localizable' => 0, | |
506 | 'html' => [ | |
507 | 'type' => 'Text', | |
508 | ], | |
a9d0587b | 509 | 'add' => '5.20', |
1f34d30a | 510 | ], |
c3fc2621 | 511 | ]; |
346aaaba | 512 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 513 | } |
346aaaba | 514 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 515 | } |
c3fc2621 | 516 | |
e501603b | 517 | /** |
bd8e0b14 | 518 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
519 | * |
520 | * @return array | |
bd8e0b14 | 521 | * Array(string $name => string $uniqueName). |
e501603b | 522 | */ |
c3fc2621 | 523 | public static function &fieldKeys() { |
bd8e0b14 TO |
524 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
525 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 526 | } |
bd8e0b14 | 527 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 528 | } |
c3fc2621 | 529 | |
e501603b TO |
530 | /** |
531 | * Returns the names of this table | |
532 | * | |
533 | * @return string | |
534 | */ | |
c3fc2621 | 535 | public static function getTableName() { |
e501603b TO |
536 | return self::$_tableName; |
537 | } | |
c3fc2621 | 538 | |
e501603b TO |
539 | /** |
540 | * Returns if this table needs to be logged | |
541 | * | |
c3fc2621 | 542 | * @return bool |
e501603b | 543 | */ |
c3fc2621 | 544 | public function getLog() { |
e501603b TO |
545 | return self::$_log; |
546 | } | |
c3fc2621 | 547 | |
e501603b TO |
548 | /** |
549 | * Returns the list of fields that can be imported | |
550 | * | |
551 | * @param bool $prefix | |
552 | * | |
553 | * @return array | |
554 | */ | |
c3fc2621 CW |
555 | public static function &import($prefix = FALSE) { |
556 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'financial_trxn', $prefix, []); | |
60808919 | 557 | return $r; |
e501603b | 558 | } |
c3fc2621 | 559 | |
e501603b TO |
560 | /** |
561 | * Returns the list of fields that can be exported | |
562 | * | |
563 | * @param bool $prefix | |
564 | * | |
565 | * @return array | |
566 | */ | |
c3fc2621 CW |
567 | public static function &export($prefix = FALSE) { |
568 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'financial_trxn', $prefix, []); | |
60808919 | 569 | return $r; |
e501603b | 570 | } |
c3fc2621 | 571 | |
e7a6b91a AS |
572 | /** |
573 | * Returns the list of indices | |
c3fc2621 CW |
574 | * |
575 | * @param bool $localize | |
576 | * | |
577 | * @return array | |
e7a6b91a AS |
578 | */ |
579 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
580 | $indices = [ |
581 | 'UI_ftrxn_trxn_id' => [ | |
e7a6b91a | 582 | 'name' => 'UI_ftrxn_trxn_id', |
c3fc2621 | 583 | 'field' => [ |
e7a6b91a | 584 | 0 => 'trxn_id', |
c3fc2621 CW |
585 | ], |
586 | 'localizable' => FALSE, | |
e7a6b91a | 587 | 'sig' => 'civicrm_financial_trxn::0::trxn_id', |
c3fc2621 CW |
588 | ], |
589 | 'UI_ftrxn_payment_instrument_id' => [ | |
e7a6b91a | 590 | 'name' => 'UI_ftrxn_payment_instrument_id', |
c3fc2621 | 591 | 'field' => [ |
e7a6b91a | 592 | 0 => 'payment_instrument_id', |
c3fc2621 CW |
593 | ], |
594 | 'localizable' => FALSE, | |
e7a6b91a | 595 | 'sig' => 'civicrm_financial_trxn::0::payment_instrument_id', |
c3fc2621 CW |
596 | ], |
597 | 'UI_ftrxn_check_number' => [ | |
e7a6b91a | 598 | 'name' => 'UI_ftrxn_check_number', |
c3fc2621 | 599 | 'field' => [ |
e7a6b91a | 600 | 0 => 'check_number', |
c3fc2621 CW |
601 | ], |
602 | 'localizable' => FALSE, | |
e7a6b91a | 603 | 'sig' => 'civicrm_financial_trxn::0::check_number', |
c3fc2621 CW |
604 | ], |
605 | ]; | |
e7a6b91a AS |
606 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
607 | } | |
c3fc2621 | 608 | |
e501603b | 609 | } |