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