Regenerate DAOs with readonly attribute for id fields
[civicrm-core.git] / CRM / Contribute / DAO / Contribution.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
ca5cec67 5 * @copyright CiviCRM LLC https://civicrm.org/licensing
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Contribute/Contribution.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
1fe423d6 9 * (GenCodeChecksum:92fe08f4921e963467ae0d3ae05777ac)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the Contribution entity.
f41f0342 14 */
e501603b 15class CRM_Contribute_DAO_Contribution 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_contribution';
c3fc2621 26
449c4e6b
CW
27 /**
28 * Icon associated with this entity.
29 *
30 * @var string
31 */
32 public static $_icon = 'fa-credit-card';
33
e501603b 34 /**
f41f0342 35 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 36 *
c3fc2621 37 * @var bool
e501603b 38 */
fa45b5b9 39 public static $_log = TRUE;
c3fc2621 40
a7bd99ff
CW
41 /**
42 * Paths for accessing this entity in the UI.
43 *
44 * @var string[]
45 */
46 protected static $_paths = [
5c385299 47 'add' => 'civicrm/contribute/add?reset=1&action=add&context=standalone',
a7bd99ff 48 'view' => 'civicrm/contact/view/contribution?reset=1&action=view&id=[id]',
5c385299 49 'update' => 'civicrm/contact/view/contribution?reset=1&action=update&id=[id]',
a7bd99ff
CW
50 'delete' => 'civicrm/contact/view/contribution?reset=1&action=delete&id=[id]',
51 ];
52
e501603b
TO
53 /**
54 * Contribution ID
55 *
e6ca0a57 56 * @var int
e501603b
TO
57 */
58 public $id;
c3fc2621 59
e501603b
TO
60 /**
61 * FK to Contact ID
62 *
e6ca0a57 63 * @var int
e501603b
TO
64 */
65 public $contact_id;
c3fc2621 66
e501603b
TO
67 /**
68 * FK to Financial Type for (total_amount - non_deductible_amount).
69 *
e6ca0a57 70 * @var int
e501603b
TO
71 */
72 public $financial_type_id;
c3fc2621 73
e501603b
TO
74 /**
75 * The Contribution Page which triggered this contribution
76 *
e6ca0a57 77 * @var int
e501603b
TO
78 */
79 public $contribution_page_id;
c3fc2621 80
e501603b
TO
81 /**
82 * FK to Payment Instrument
83 *
e6ca0a57 84 * @var int
e501603b
TO
85 */
86 public $payment_instrument_id;
c3fc2621 87
e501603b
TO
88 /**
89 * Date contribution was received - not necessarily the creation date of the record
90 *
91 * @var datetime
92 */
93 public $receive_date;
c3fc2621 94
e501603b
TO
95 /**
96 * Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types.
97 *
98 * @var float
99 */
100 public $non_deductible_amount;
c3fc2621 101
e501603b
TO
102 /**
103 * Total amount of this contribution. Use market value for non-monetary gifts.
104 *
105 * @var float
106 */
107 public $total_amount;
c3fc2621 108
e501603b
TO
109 /**
110 * actual processor fee if known - may be 0.
111 *
112 * @var float
113 */
114 public $fee_amount;
c3fc2621 115
e501603b
TO
116 /**
117 * actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.
118 *
119 * @var float
120 */
121 public $net_amount;
c3fc2621 122
e501603b
TO
123 /**
124 * unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method
125 *
126 * @var string
127 */
128 public $trxn_id;
c3fc2621 129
e501603b
TO
130 /**
131 * unique invoice id, system generated or passed in
132 *
133 * @var string
134 */
135 public $invoice_id;
c3fc2621 136
9cad3ff4
CW
137 /**
138 * Human readable invoice number
139 *
140 * @var string
141 */
142 public $invoice_number;
c3fc2621 143
e501603b
TO
144 /**
145 * 3 character string, value from config setting or input via user.
146 *
147 * @var string
148 */
149 public $currency;
c3fc2621 150
e501603b
TO
151 /**
152 * when was gift cancelled
153 *
154 * @var datetime
155 */
156 public $cancel_date;
c3fc2621 157
e501603b 158 /**
e501603b
TO
159 * @var text
160 */
161 public $cancel_reason;
c3fc2621 162
e501603b
TO
163 /**
164 * when (if) receipt was sent. populated automatically for online donations w/ automatic receipting
165 *
166 * @var datetime
167 */
168 public $receipt_date;
c3fc2621 169
e501603b
TO
170 /**
171 * when (if) was donor thanked
172 *
173 * @var datetime
174 */
175 public $thankyou_date;
c3fc2621 176
e501603b
TO
177 /**
178 * Origin of this Contribution.
179 *
180 * @var string
181 */
182 public $source;
c3fc2621 183
e501603b 184 /**
e501603b
TO
185 * @var text
186 */
187 public $amount_level;
c3fc2621 188
e501603b
TO
189 /**
190 * Conditional foreign key to civicrm_contribution_recur id. Each contribution made in connection with a recurring contribution carries a foreign key to the recurring contribution record. This assumes we can track these processor initiated events.
191 *
e6ca0a57 192 * @var int
e501603b
TO
193 */
194 public $contribution_recur_id;
c3fc2621 195
e501603b 196 /**
e6ca0a57 197 * @var bool
e501603b
TO
198 */
199 public $is_test;
c3fc2621 200
e501603b 201 /**
e6ca0a57 202 * @var bool
e501603b
TO
203 */
204 public $is_pay_later;
c3fc2621 205
e501603b 206 /**
e6ca0a57 207 * @var int
e501603b
TO
208 */
209 public $contribution_status_id;
c3fc2621 210
e501603b
TO
211 /**
212 * Conditional foreign key to civicrm_address.id. We insert an address record for each contribution when we have associated billing name and address data.
213 *
e6ca0a57 214 * @var int
e501603b
TO
215 */
216 public $address_id;
c3fc2621 217
e501603b 218 /**
e501603b
TO
219 * @var string
220 */
221 public $check_number;
c3fc2621 222
e501603b
TO
223 /**
224 * The campaign for which this contribution has been triggered.
225 *
e6ca0a57 226 * @var int
e501603b
TO
227 */
228 public $campaign_id;
c3fc2621 229
e501603b
TO
230 /**
231 * unique credit note id, system generated or passed in
232 *
233 * @var string
234 */
235 public $creditnote_id;
c3fc2621 236
e501603b
TO
237 /**
238 * Total tax amount of this contribution.
239 *
240 * @var float
241 */
242 public $tax_amount;
c3fc2621 243
e501603b
TO
244 /**
245 * Stores the date when revenue should be recognized.
246 *
247 * @var datetime
248 */
249 public $revenue_recognition_date;
c3fc2621 250
dc396835
AS
251 /**
252 * Shows this is a template for recurring contributions.
253 *
254 * @var bool
255 */
256 public $is_template;
257
e501603b 258 /**
f41f0342 259 * Class constructor.
e501603b 260 */
c3fc2621 261 public function __construct() {
e501603b
TO
262 $this->__table = 'civicrm_contribution';
263 parent::__construct();
264 }
c3fc2621 265
449c4e6b
CW
266 /**
267 * Returns localized title of this entity.
7b66c3b5
AH
268 *
269 * @param bool $plural
270 * Whether to return the plural version of the title.
449c4e6b 271 */
7b66c3b5
AH
272 public static function getEntityTitle($plural = FALSE) {
273 return $plural ? ts('Contributions') : ts('Contribution');
449c4e6b
CW
274 }
275
e501603b 276 /**
f41f0342 277 * Returns foreign keys and entity references.
e501603b
TO
278 *
279 * @return array
280 * [CRM_Core_Reference_Interface]
281 */
c3fc2621 282 public static function getReferenceColumns() {
346aaaba 283 if (!isset(Civi::$statics[__CLASS__]['links'])) {
fa45b5b9 284 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621
CW
285 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id');
286 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'financial_type_id', 'civicrm_financial_type', 'id');
287 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contribution_page_id', 'civicrm_contribution_page', 'id');
288 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contribution_recur_id', 'civicrm_contribution_recur', 'id');
289 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'address_id', 'civicrm_address', 'id');
290 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'campaign_id', 'civicrm_campaign', 'id');
346aaaba 291 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 292 }
346aaaba 293 return Civi::$statics[__CLASS__]['links'];
e501603b 294 }
c3fc2621 295
e501603b
TO
296 /**
297 * Returns all the column names of this table
298 *
299 * @return array
300 */
c3fc2621 301 public static function &fields() {
346aaaba 302 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
303 Civi::$statics[__CLASS__]['fields'] = [
304 'contribution_id' => [
e501603b
TO
305 'name' => 'id',
306 'type' => CRM_Utils_Type::T_INT,
c3fc2621 307 'title' => ts('Contribution ID'),
215b423e 308 'description' => ts('Contribution ID'),
c3fc2621
CW
309 'required' => TRUE,
310 'import' => TRUE,
e501603b 311 'where' => 'civicrm_contribution.id',
c3fc2621 312 'export' => TRUE,
522a26c9 313 'table_name' => 'civicrm_contribution',
314 'entity' => 'Contribution',
315 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 316 'localizable' => 0,
8cc7686b 317 'html' => [
2cbbebe8 318 'type' => 'Number',
8cc7686b 319 ],
1fe423d6 320 'readonly' => TRUE,
a9d0587b 321 'add' => '1.3',
c3fc2621
CW
322 ],
323 'contribution_contact_id' => [
e501603b
TO
324 'name' => 'contact_id',
325 'type' => CRM_Utils_Type::T_INT,
c3fc2621 326 'title' => ts('Contact ID'),
215b423e 327 'description' => ts('FK to Contact ID'),
c3fc2621
CW
328 'required' => TRUE,
329 'import' => TRUE,
e501603b
TO
330 'where' => 'civicrm_contribution.contact_id',
331 'headerPattern' => '/contact(.?id)?/i',
332 'dataPattern' => '/^\d+$/',
c3fc2621 333 'export' => TRUE,
522a26c9 334 'table_name' => 'civicrm_contribution',
335 'entity' => 'Contribution',
336 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 337 'localizable' => 0,
e501603b 338 'FKClassName' => 'CRM_Contact_DAO_Contact',
c3fc2621 339 'html' => [
e501603b 340 'type' => 'EntityRef',
2cbbebe8 341 'label' => ts("Contact"),
c3fc2621 342 ],
a9d0587b 343 'add' => '1.3',
c3fc2621
CW
344 ],
345 'financial_type_id' => [
e501603b
TO
346 'name' => 'financial_type_id',
347 'type' => CRM_Utils_Type::T_INT,
a1d226d6 348 'title' => ts('Financial Type ID'),
215b423e 349 'description' => ts('FK to Financial Type for (total_amount - non_deductible_amount).'),
e501603b 350 'where' => 'civicrm_contribution.financial_type_id',
a36434b9 351 'export' => TRUE,
522a26c9 352 'table_name' => 'civicrm_contribution',
353 'entity' => 'Contribution',
354 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 355 'localizable' => 0,
e501603b 356 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
c3fc2621 357 'html' => [
e501603b 358 'type' => 'Select',
a1d226d6 359 'label' => ts("Financial Type"),
c3fc2621
CW
360 ],
361 'pseudoconstant' => [
e501603b
TO
362 'table' => 'civicrm_financial_type',
363 'keyColumn' => 'id',
364 'labelColumn' => 'name',
e6ca0a57 365 ],
a9d0587b 366 'add' => '4.3',
c3fc2621
CW
367 ],
368 'contribution_page_id' => [
e501603b
TO
369 'name' => 'contribution_page_id',
370 'type' => CRM_Utils_Type::T_INT,
c3fc2621 371 'title' => ts('Contribution Page ID'),
215b423e 372 'description' => ts('The Contribution Page which triggered this contribution'),
c3fc2621 373 'import' => TRUE,
e501603b 374 'where' => 'civicrm_contribution.contribution_page_id',
c3fc2621 375 'export' => TRUE,
522a26c9 376 'table_name' => 'civicrm_contribution',
377 'entity' => 'Contribution',
378 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 379 'localizable' => 0,
e501603b 380 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
c3fc2621 381 'html' => [
e501603b 382 'type' => 'Select',
cff5e6b9 383 'label' => ts("Contribution Page"),
c3fc2621
CW
384 ],
385 'pseudoconstant' => [
e501603b
TO
386 'table' => 'civicrm_contribution_page',
387 'keyColumn' => 'id',
388 'labelColumn' => 'title',
e6ca0a57 389 ],
a9d0587b 390 'add' => '1.5',
c3fc2621
CW
391 ],
392 'payment_instrument_id' => [
e501603b
TO
393 'name' => 'payment_instrument_id',
394 'type' => CRM_Utils_Type::T_INT,
c3fc2621 395 'title' => ts('Payment Method ID'),
215b423e 396 'description' => ts('FK to Payment Instrument'),
9d5c7f14 397 'where' => 'civicrm_contribution.payment_instrument_id',
398 'headerPattern' => '/^payment|(p(ayment\s)?instrument)$/i',
a36434b9 399 'export' => TRUE,
522a26c9 400 'table_name' => 'civicrm_contribution',
401 'entity' => 'Contribution',
402 'bao' => 'CRM_Contribute_BAO_Contribution',
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 ],
a9d0587b 411 'add' => '1.3',
c3fc2621
CW
412 ],
413 'receive_date' => [
e501603b
TO
414 'name' => 'receive_date',
415 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
c3fc2621 416 'title' => ts('Date Received'),
215b423e 417 'description' => ts('Date contribution was received - not necessarily the creation date of the record'),
c3fc2621 418 'import' => TRUE,
e501603b
TO
419 'where' => 'civicrm_contribution.receive_date',
420 'headerPattern' => '/receive(.?date)?/i',
421 'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
c3fc2621 422 'export' => TRUE,
522a26c9 423 'table_name' => 'civicrm_contribution',
424 'entity' => 'Contribution',
425 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 426 'localizable' => 0,
c3fc2621 427 'html' => [
e501603b 428 'type' => 'Select Date',
24317d89 429 'formatType' => 'activityDateTime',
c3fc2621 430 ],
a9d0587b 431 'add' => '1.3',
c3fc2621
CW
432 ],
433 'non_deductible_amount' => [
e501603b
TO
434 'name' => 'non_deductible_amount',
435 'type' => CRM_Utils_Type::T_MONEY,
c3fc2621 436 'title' => ts('Non-deductible Amount'),
215b423e 437 'description' => ts('Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types.'),
c3fc2621 438 'precision' => [
e501603b 439 20,
fb607354 440 2,
c3fc2621
CW
441 ],
442 'import' => TRUE,
e501603b
TO
443 'where' => 'civicrm_contribution.non_deductible_amount',
444 'headerPattern' => '/non?.?deduct/i',
445 'dataPattern' => '/^\d+(\.\d{2})?$/',
c3fc2621 446 'export' => TRUE,
45a83e42 447 'default' => '0',
522a26c9 448 'table_name' => 'civicrm_contribution',
449 'entity' => 'Contribution',
450 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 451 'localizable' => 0,
c3fc2621 452 'html' => [
e501603b 453 'type' => 'Text',
c3fc2621 454 ],
a9d0587b 455 'add' => '1.3',
c3fc2621
CW
456 ],
457 'total_amount' => [
e501603b
TO
458 'name' => 'total_amount',
459 'type' => CRM_Utils_Type::T_MONEY,
c3fc2621 460 'title' => ts('Total Amount'),
215b423e 461 'description' => ts('Total amount of this contribution. Use market value for non-monetary gifts.'),
c3fc2621
CW
462 'required' => TRUE,
463 'precision' => [
e501603b 464 20,
fb607354 465 2,
c3fc2621
CW
466 ],
467 'import' => TRUE,
e501603b
TO
468 'where' => 'civicrm_contribution.total_amount',
469 'headerPattern' => '/^total|(.?^am(ou)?nt)/i',
470 'dataPattern' => '/^\d+(\.\d{2})?$/',
c3fc2621 471 'export' => TRUE,
522a26c9 472 'table_name' => 'civicrm_contribution',
473 'entity' => 'Contribution',
474 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 475 'localizable' => 0,
c3fc2621 476 'html' => [
e501603b 477 'type' => 'Text',
c23563e3 478 'label' => ts("Total Amount"),
c3fc2621 479 ],
a9d0587b 480 'add' => '1.3',
c3fc2621
CW
481 ],
482 'fee_amount' => [
e501603b
TO
483 'name' => 'fee_amount',
484 'type' => CRM_Utils_Type::T_MONEY,
c3fc2621 485 'title' => ts('Fee Amount'),
215b423e 486 'description' => ts('actual processor fee if known - may be 0.'),
c3fc2621 487 'precision' => [
e501603b 488 20,
fb607354 489 2,
c3fc2621
CW
490 ],
491 'import' => TRUE,
e501603b
TO
492 'where' => 'civicrm_contribution.fee_amount',
493 'headerPattern' => '/fee(.?am(ou)?nt)?/i',
494 'dataPattern' => '/^\d+(\.\d{2})?$/',
c3fc2621 495 'export' => TRUE,
522a26c9 496 'table_name' => 'civicrm_contribution',
497 'entity' => 'Contribution',
498 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 499 'localizable' => 0,
c3fc2621 500 'html' => [
e501603b 501 'type' => 'Text',
c23563e3 502 'label' => ts("Fee Amount"),
c3fc2621 503 ],
a9d0587b 504 'add' => '1.3',
c3fc2621
CW
505 ],
506 'net_amount' => [
e501603b
TO
507 'name' => 'net_amount',
508 'type' => CRM_Utils_Type::T_MONEY,
c3fc2621 509 'title' => ts('Net Amount'),
215b423e 510 '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 511 'precision' => [
e501603b 512 20,
fb607354 513 2,
c3fc2621
CW
514 ],
515 'import' => TRUE,
e501603b
TO
516 'where' => 'civicrm_contribution.net_amount',
517 'headerPattern' => '/net(.?am(ou)?nt)?/i',
518 'dataPattern' => '/^\d+(\.\d{2})?$/',
c3fc2621 519 'export' => TRUE,
522a26c9 520 'table_name' => 'civicrm_contribution',
521 'entity' => 'Contribution',
522 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 523 'localizable' => 0,
c3fc2621 524 'html' => [
e501603b 525 'type' => 'Text',
c23563e3 526 'label' => ts("Net Amount"),
c3fc2621 527 ],
a9d0587b 528 'add' => '1.3',
c3fc2621
CW
529 ],
530 'trxn_id' => [
e501603b
TO
531 'name' => 'trxn_id',
532 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 533 'title' => ts('Transaction ID'),
215b423e 534 'description' => ts('unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method'),
e501603b
TO
535 'maxlength' => 255,
536 'size' => CRM_Utils_Type::HUGE,
c3fc2621 537 'import' => TRUE,
e501603b
TO
538 'where' => 'civicrm_contribution.trxn_id',
539 'headerPattern' => '/tr(ansactio|x)n(.?id)?/i',
c3fc2621 540 'export' => TRUE,
522a26c9 541 'table_name' => 'civicrm_contribution',
542 'entity' => 'Contribution',
543 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 544 'localizable' => 0,
c3fc2621 545 'html' => [
e501603b 546 'type' => 'Text',
c3fc2621 547 ],
a9d0587b 548 'add' => '1.3',
c3fc2621
CW
549 ],
550 'invoice_id' => [
e501603b
TO
551 'name' => 'invoice_id',
552 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 553 'title' => ts('Invoice Reference'),
215b423e 554 'description' => ts('unique invoice id, system generated or passed in'),
e501603b
TO
555 'maxlength' => 255,
556 'size' => CRM_Utils_Type::HUGE,
c3fc2621 557 'import' => TRUE,
e501603b
TO
558 'where' => 'civicrm_contribution.invoice_id',
559 'headerPattern' => '/invoice(.?id)?/i',
c3fc2621 560 'export' => TRUE,
522a26c9 561 'table_name' => 'civicrm_contribution',
562 'entity' => 'Contribution',
563 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 564 'localizable' => 0,
c3fc2621 565 'html' => [
e501603b 566 'type' => 'Text',
c3fc2621 567 ],
a9d0587b 568 'add' => '1.3',
c3fc2621
CW
569 ],
570 'invoice_number' => [
9cad3ff4
CW
571 'name' => 'invoice_number',
572 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 573 'title' => ts('Invoice Number'),
215b423e 574 'description' => ts('Human readable invoice number'),
9cad3ff4
CW
575 'maxlength' => 255,
576 'size' => CRM_Utils_Type::HUGE,
c3fc2621 577 'import' => TRUE,
9cad3ff4
CW
578 'where' => 'civicrm_contribution.invoice_number',
579 'headerPattern' => '/invoice(.?number)?/i',
c3fc2621 580 'export' => TRUE,
9cad3ff4
CW
581 'table_name' => 'civicrm_contribution',
582 'entity' => 'Contribution',
583 'bao' => 'CRM_Contribute_BAO_Contribution',
584 'localizable' => 0,
c3fc2621 585 'html' => [
9cad3ff4 586 'type' => 'Text',
c3fc2621 587 ],
a9d0587b 588 'add' => '4.7',
c3fc2621
CW
589 ],
590 'currency' => [
e501603b
TO
591 'name' => 'currency',
592 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 593 'title' => ts('Currency'),
215b423e 594 'description' => ts('3 character string, value from config setting or input via user.'),
e501603b
TO
595 'maxlength' => 3,
596 'size' => CRM_Utils_Type::FOUR,
c3fc2621 597 'import' => TRUE,
e501603b
TO
598 'where' => 'civicrm_contribution.currency',
599 'headerPattern' => '/cur(rency)?/i',
600 'dataPattern' => '/^[A-Z]{3}$/i',
c3fc2621 601 'export' => TRUE,
e501603b 602 'default' => 'NULL',
522a26c9 603 'table_name' => 'civicrm_contribution',
604 'entity' => 'Contribution',
605 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 606 'localizable' => 0,
c3fc2621 607 'html' => [
e501603b 608 'type' => 'Select',
c23563e3 609 'label' => ts("Currency"),
c3fc2621
CW
610 ],
611 'pseudoconstant' => [
e501603b
TO
612 'table' => 'civicrm_currency',
613 'keyColumn' => 'name',
614 'labelColumn' => 'full_name',
615 'nameColumn' => 'name',
a8fdb24e 616 'abbrColumn' => 'symbol',
e6ca0a57 617 ],
a9d0587b 618 'add' => '1.3',
c3fc2621 619 ],
6e7cc0f5 620 'contribution_cancel_date' => [
e501603b
TO
621 'name' => 'cancel_date',
622 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
6e7cc0f5 623 'title' => ts('Cancelled / Refunded Date'),
215b423e 624 'description' => ts('when was gift cancelled'),
c3fc2621 625 'import' => TRUE,
e501603b
TO
626 'where' => 'civicrm_contribution.cancel_date',
627 'headerPattern' => '/cancel(.?date)?/i',
628 'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
c3fc2621 629 'export' => TRUE,
522a26c9 630 'table_name' => 'civicrm_contribution',
631 'entity' => 'Contribution',
632 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 633 'localizable' => 0,
c3fc2621 634 'html' => [
e501603b 635 'type' => 'Select Date',
24317d89 636 'formatType' => 'activityDateTime',
c3fc2621 637 ],
a9d0587b 638 'add' => '1.3',
c3fc2621
CW
639 ],
640 'cancel_reason' => [
e501603b
TO
641 'name' => 'cancel_reason',
642 'type' => CRM_Utils_Type::T_TEXT,
927898c5 643 'title' => ts('Cancellation / Refund Reason'),
c3fc2621 644 'import' => TRUE,
e501603b
TO
645 'where' => 'civicrm_contribution.cancel_reason',
646 'headerPattern' => '/(cancel.?)?reason/i',
c3fc2621 647 'export' => TRUE,
522a26c9 648 'table_name' => 'civicrm_contribution',
649 'entity' => 'Contribution',
650 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 651 'localizable' => 0,
c3fc2621 652 'html' => [
e501603b 653 'type' => 'Text',
c3fc2621 654 ],
a9d0587b 655 'add' => '1.3',
c3fc2621
CW
656 ],
657 'receipt_date' => [
e501603b
TO
658 'name' => 'receipt_date',
659 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
c3fc2621 660 'title' => ts('Receipt Date'),
215b423e 661 'description' => ts('when (if) receipt was sent. populated automatically for online donations w/ automatic receipting'),
c3fc2621 662 'import' => TRUE,
e501603b
TO
663 'where' => 'civicrm_contribution.receipt_date',
664 'headerPattern' => '/receipt(.?date)?/i',
665 'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
c3fc2621 666 'export' => TRUE,
522a26c9 667 'table_name' => 'civicrm_contribution',
668 'entity' => 'Contribution',
669 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 670 'localizable' => 0,
c3fc2621 671 'html' => [
e501603b 672 'type' => 'Select Date',
24317d89 673 'formatType' => 'activityDateTime',
c23563e3 674 'label' => ts("Receipt Date"),
c3fc2621 675 ],
a9d0587b 676 'add' => '1.3',
c3fc2621
CW
677 ],
678 'thankyou_date' => [
e501603b
TO
679 'name' => 'thankyou_date',
680 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
c3fc2621 681 'title' => ts('Thank-you Date'),
215b423e 682 'description' => ts('when (if) was donor thanked'),
c3fc2621 683 'import' => TRUE,
e501603b
TO
684 'where' => 'civicrm_contribution.thankyou_date',
685 'headerPattern' => '/thank(s|(.?you))?(.?date)?/i',
686 'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
c3fc2621 687 'export' => TRUE,
522a26c9 688 'table_name' => 'civicrm_contribution',
689 'entity' => 'Contribution',
690 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 691 'localizable' => 0,
c3fc2621 692 'html' => [
e501603b 693 'type' => 'Select Date',
24317d89 694 'formatType' => 'activityDateTime',
c3fc2621 695 ],
a9d0587b 696 'add' => '1.3',
c3fc2621
CW
697 ],
698 'contribution_source' => [
e501603b
TO
699 'name' => 'source',
700 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 701 'title' => ts('Contribution Source'),
215b423e 702 'description' => ts('Origin of this Contribution.'),
e501603b
TO
703 'maxlength' => 255,
704 'size' => CRM_Utils_Type::HUGE,
c3fc2621 705 'import' => TRUE,
e501603b
TO
706 'where' => 'civicrm_contribution.source',
707 'headerPattern' => '/source/i',
c3fc2621 708 'export' => TRUE,
522a26c9 709 'table_name' => 'civicrm_contribution',
710 'entity' => 'Contribution',
711 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 712 'localizable' => 0,
c3fc2621 713 'html' => [
e501603b 714 'type' => 'Text',
c3fc2621 715 ],
a9d0587b 716 'add' => '1.3',
c3fc2621
CW
717 ],
718 'amount_level' => [
e501603b
TO
719 'name' => 'amount_level',
720 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621
CW
721 'title' => ts('Amount Label'),
722 'import' => TRUE,
e501603b 723 'where' => 'civicrm_contribution.amount_level',
c3fc2621 724 'export' => TRUE,
522a26c9 725 'table_name' => 'civicrm_contribution',
726 'entity' => 'Contribution',
727 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 728 'localizable' => 0,
c3fc2621 729 'html' => [
e501603b 730 'type' => 'Text',
c3fc2621 731 ],
a9d0587b 732 'add' => '1.7',
c3fc2621
CW
733 ],
734 'contribution_recur_id' => [
e501603b
TO
735 'name' => 'contribution_recur_id',
736 'type' => CRM_Utils_Type::T_INT,
c3fc2621 737 'title' => ts('Recurring Contribution ID'),
215b423e 738 'description' => ts('Conditional foreign key to civicrm_contribution_recur id. Each contribution made in connection with a recurring contribution carries a foreign key to the recurring contribution record. This assumes we can track these processor initiated events.'),
3123273f 739 'where' => 'civicrm_contribution.contribution_recur_id',
a36434b9 740 'export' => TRUE,
522a26c9 741 'table_name' => 'civicrm_contribution',
742 'entity' => 'Contribution',
743 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 744 'localizable' => 0,
e501603b 745 'FKClassName' => 'CRM_Contribute_DAO_ContributionRecur',
2cbbebe8
A
746 'html' => [
747 'label' => ts("Recurring Contribution"),
748 ],
a9d0587b 749 'add' => '1.4',
c3fc2621
CW
750 ],
751 'is_test' => [
e501603b
TO
752 'name' => 'is_test',
753 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621
CW
754 'title' => ts('Test'),
755 'import' => TRUE,
e501603b 756 'where' => 'civicrm_contribution.is_test',
c3fc2621 757 'export' => TRUE,
45a83e42 758 'default' => '0',
522a26c9 759 'table_name' => 'civicrm_contribution',
760 'entity' => 'Contribution',
761 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 762 'localizable' => 0,
c3fc2621 763 'html' => [
e501603b 764 'type' => 'CheckBox',
c3fc2621 765 ],
a9d0587b 766 'add' => NULL,
c3fc2621
CW
767 ],
768 'is_pay_later' => [
e501603b
TO
769 'name' => 'is_pay_later',
770 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621
CW
771 'title' => ts('Is Pay Later'),
772 'import' => TRUE,
e501603b 773 'where' => 'civicrm_contribution.is_pay_later',
c3fc2621 774 'export' => TRUE,
45a83e42 775 'default' => '0',
522a26c9 776 'table_name' => 'civicrm_contribution',
777 'entity' => 'Contribution',
778 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 779 'localizable' => 0,
c3fc2621 780 'html' => [
e501603b 781 'type' => 'CheckBox',
c3fc2621 782 ],
a9d0587b 783 'add' => '2.1',
c3fc2621
CW
784 ],
785 'contribution_status_id' => [
e501603b
TO
786 'name' => 'contribution_status_id',
787 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
788 'title' => ts('Contribution Status ID'),
789 'import' => TRUE,
e501603b
TO
790 'where' => 'civicrm_contribution.contribution_status_id',
791 'headerPattern' => '/status/i',
c3fc2621 792 'export' => TRUE,
e501603b 793 'default' => '1',
522a26c9 794 'table_name' => 'civicrm_contribution',
795 'entity' => 'Contribution',
796 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 797 'localizable' => 0,
c3fc2621 798 'html' => [
e501603b 799 'type' => 'Select',
c3fc2621
CW
800 ],
801 'pseudoconstant' => [
e501603b
TO
802 'optionGroupName' => 'contribution_status',
803 'optionEditPath' => 'civicrm/admin/options/contribution_status',
e6ca0a57 804 ],
a9d0587b 805 'add' => '1.6',
c3fc2621
CW
806 ],
807 'contribution_address_id' => [
e501603b
TO
808 'name' => 'address_id',
809 'type' => CRM_Utils_Type::T_INT,
2cbbebe8 810 'title' => ts('Address ID'),
215b423e 811 'description' => ts('Conditional foreign key to civicrm_address.id. We insert an address record for each contribution when we have associated billing name and address data.'),
3123273f 812 'where' => 'civicrm_contribution.address_id',
a36434b9 813 'export' => TRUE,
522a26c9 814 'table_name' => 'civicrm_contribution',
815 'entity' => 'Contribution',
816 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 817 'localizable' => 0,
e501603b 818 'FKClassName' => 'CRM_Core_DAO_Address',
2cbbebe8
A
819 'html' => [
820 'label' => ts("Address"),
821 ],
a9d0587b 822 'add' => '2.2',
c3fc2621
CW
823 ],
824 'contribution_check_number' => [
e501603b
TO
825 'name' => 'check_number',
826 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 827 'title' => ts('Check Number'),
e501603b
TO
828 'maxlength' => 255,
829 'size' => 6,
c3fc2621 830 'import' => TRUE,
e501603b
TO
831 'where' => 'civicrm_contribution.check_number',
832 'headerPattern' => '/check(.?number)?/i',
c3fc2621 833 'export' => TRUE,
522a26c9 834 'table_name' => 'civicrm_contribution',
835 'entity' => 'Contribution',
836 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 837 'localizable' => 0,
c3fc2621 838 'html' => [
e501603b 839 'type' => 'Text',
c3fc2621 840 ],
a9d0587b 841 'add' => '2.2',
c3fc2621
CW
842 ],
843 'contribution_campaign_id' => [
e501603b
TO
844 'name' => 'campaign_id',
845 'type' => CRM_Utils_Type::T_INT,
2cbbebe8 846 'title' => ts('Campaign ID'),
215b423e 847 'description' => ts('The campaign for which this contribution has been triggered.'),
c3fc2621 848 'import' => TRUE,
e501603b 849 'where' => 'civicrm_contribution.campaign_id',
c3fc2621 850 'export' => TRUE,
522a26c9 851 'table_name' => 'civicrm_contribution',
852 'entity' => 'Contribution',
853 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 854 'localizable' => 0,
e501603b 855 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
c3fc2621 856 'html' => [
e501603b 857 'type' => 'Select',
2cbbebe8 858 'label' => ts("Campaign"),
c3fc2621 859 ],
a9d0587b 860 'add' => '3.4',
c3fc2621
CW
861 ],
862 'creditnote_id' => [
e501603b
TO
863 'name' => 'creditnote_id',
864 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 865 'title' => ts('Credit Note ID'),
215b423e 866 'description' => ts('unique credit note id, system generated or passed in'),
e501603b
TO
867 'maxlength' => 255,
868 'size' => CRM_Utils_Type::HUGE,
c3fc2621 869 'import' => TRUE,
e501603b
TO
870 'where' => 'civicrm_contribution.creditnote_id',
871 'headerPattern' => '/creditnote(.?id)?/i',
c3fc2621 872 'export' => TRUE,
522a26c9 873 'table_name' => 'civicrm_contribution',
874 'entity' => 'Contribution',
875 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 876 'localizable' => 0,
c3fc2621 877 'html' => [
e501603b 878 'type' => 'Text',
c3fc2621 879 ],
a9d0587b 880 'add' => '4.6',
c3fc2621
CW
881 ],
882 'tax_amount' => [
e501603b
TO
883 'name' => 'tax_amount',
884 'type' => CRM_Utils_Type::T_MONEY,
c3fc2621 885 'title' => ts('Tax Amount'),
215b423e 886 'description' => ts('Total tax amount of this contribution.'),
c3fc2621 887 'precision' => [
e501603b 888 20,
fb607354 889 2,
c3fc2621
CW
890 ],
891 'import' => TRUE,
e501603b
TO
892 'where' => 'civicrm_contribution.tax_amount',
893 'headerPattern' => '/tax(.?am(ou)?nt)?/i',
894 'dataPattern' => '/^\d+(\.\d{2})?$/',
c3fc2621 895 'export' => TRUE,
522a26c9 896 'table_name' => 'civicrm_contribution',
897 'entity' => 'Contribution',
898 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 899 'localizable' => 0,
c3fc2621 900 'html' => [
e501603b 901 'type' => 'Text',
c3fc2621 902 ],
a9d0587b 903 'add' => '4.6',
c3fc2621
CW
904 ],
905 'revenue_recognition_date' => [
e501603b
TO
906 'name' => 'revenue_recognition_date',
907 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
c3fc2621 908 'title' => ts('Revenue Recognition Date'),
215b423e 909 'description' => ts('Stores the date when revenue should be recognized.'),
c3fc2621 910 'import' => TRUE,
e501603b
TO
911 'where' => 'civicrm_contribution.revenue_recognition_date',
912 'headerPattern' => '/revenue(.?date)?/i',
913 'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
c3fc2621 914 'export' => TRUE,
522a26c9 915 'table_name' => 'civicrm_contribution',
916 'entity' => 'Contribution',
917 'bao' => 'CRM_Contribute_BAO_Contribution',
6a7e5e5d 918 'localizable' => 0,
c3fc2621 919 'html' => [
e501603b 920 'type' => 'Select Date',
24317d89 921 'formatType' => 'activityDateTime',
c23563e3 922 'label' => ts("Revenue Recognition Date"),
c3fc2621 923 ],
a9d0587b 924 'add' => '4.7',
c3fc2621 925 ],
dc396835
AS
926 'is_template' => [
927 'name' => 'is_template',
928 'type' => CRM_Utils_Type::T_BOOLEAN,
929 'title' => ts('Is a Template Contribution'),
930 'description' => ts('Shows this is a template for recurring contributions.'),
931 'import' => TRUE,
932 'where' => 'civicrm_contribution.is_template',
933 'export' => TRUE,
934 'default' => '0',
935 'table_name' => 'civicrm_contribution',
936 'entity' => 'Contribution',
937 'bao' => 'CRM_Contribute_BAO_Contribution',
938 'localizable' => 0,
939 'html' => [
940 'type' => 'CheckBox',
941 ],
a9d0587b 942 'add' => '5.20',
dc396835 943 ],
c3fc2621 944 ];
346aaaba 945 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 946 }
346aaaba 947 return Civi::$statics[__CLASS__]['fields'];
e501603b 948 }
c3fc2621 949
e501603b 950 /**
bd8e0b14 951 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
952 *
953 * @return array
bd8e0b14 954 * Array(string $name => string $uniqueName).
e501603b 955 */
c3fc2621 956 public static function &fieldKeys() {
bd8e0b14
TO
957 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
958 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 959 }
bd8e0b14 960 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 961 }
c3fc2621 962
e501603b
TO
963 /**
964 * Returns the names of this table
965 *
966 * @return string
967 */
c3fc2621 968 public static function getTableName() {
e501603b
TO
969 return self::$_tableName;
970 }
c3fc2621 971
e501603b
TO
972 /**
973 * Returns if this table needs to be logged
974 *
c3fc2621 975 * @return bool
e501603b 976 */
c3fc2621 977 public function getLog() {
e501603b
TO
978 return self::$_log;
979 }
c3fc2621 980
e501603b
TO
981 /**
982 * Returns the list of fields that can be imported
983 *
984 * @param bool $prefix
985 *
986 * @return array
987 */
c3fc2621
CW
988 public static function &import($prefix = FALSE) {
989 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution', $prefix, []);
60808919 990 return $r;
e501603b 991 }
c3fc2621 992
e501603b
TO
993 /**
994 * Returns the list of fields that can be exported
995 *
996 * @param bool $prefix
997 *
998 * @return array
999 */
c3fc2621
CW
1000 public static function &export($prefix = FALSE) {
1001 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution', $prefix, []);
60808919 1002 return $r;
e501603b 1003 }
c3fc2621 1004
e7a6b91a
AS
1005 /**
1006 * Returns the list of indices
c3fc2621
CW
1007 *
1008 * @param bool $localize
1009 *
1010 * @return array
e7a6b91a
AS
1011 */
1012 public static function indices($localize = TRUE) {
c3fc2621
CW
1013 $indices = [
1014 'UI_contrib_payment_instrument_id' => [
e7a6b91a 1015 'name' => 'UI_contrib_payment_instrument_id',
c3fc2621 1016 'field' => [
e7a6b91a 1017 0 => 'payment_instrument_id',
c3fc2621
CW
1018 ],
1019 'localizable' => FALSE,
e7a6b91a 1020 'sig' => 'civicrm_contribution::0::payment_instrument_id',
c3fc2621
CW
1021 ],
1022 'index_total_amount_receive_date' => [
e7a6b91a 1023 'name' => 'index_total_amount_receive_date',
c3fc2621 1024 'field' => [
e7a6b91a
AS
1025 0 => 'total_amount',
1026 1 => 'receive_date',
c3fc2621
CW
1027 ],
1028 'localizable' => FALSE,
e7a6b91a 1029 'sig' => 'civicrm_contribution::0::total_amount::receive_date',
c3fc2621
CW
1030 ],
1031 'index_source' => [
e7a6b91a 1032 'name' => 'index_source',
c3fc2621 1033 'field' => [
e7a6b91a 1034 0 => 'source',
c3fc2621
CW
1035 ],
1036 'localizable' => FALSE,
e7a6b91a 1037 'sig' => 'civicrm_contribution::0::source',
c3fc2621
CW
1038 ],
1039 'UI_contrib_trxn_id' => [
e7a6b91a 1040 'name' => 'UI_contrib_trxn_id',
c3fc2621 1041 'field' => [
e7a6b91a 1042 0 => 'trxn_id',
c3fc2621
CW
1043 ],
1044 'localizable' => FALSE,
1045 'unique' => TRUE,
e7a6b91a 1046 'sig' => 'civicrm_contribution::1::trxn_id',
c3fc2621
CW
1047 ],
1048 'UI_contrib_invoice_id' => [
e7a6b91a 1049 'name' => 'UI_contrib_invoice_id',
c3fc2621 1050 'field' => [
e7a6b91a 1051 0 => 'invoice_id',
c3fc2621
CW
1052 ],
1053 'localizable' => FALSE,
1054 'unique' => TRUE,
e7a6b91a 1055 'sig' => 'civicrm_contribution::1::invoice_id',
c3fc2621
CW
1056 ],
1057 'index_contribution_status' => [
e7a6b91a 1058 'name' => 'index_contribution_status',
c3fc2621 1059 'field' => [
e7a6b91a 1060 0 => 'contribution_status_id',
c3fc2621
CW
1061 ],
1062 'localizable' => FALSE,
e7a6b91a 1063 'sig' => 'civicrm_contribution::0::contribution_status_id',
c3fc2621
CW
1064 ],
1065 'received_date' => [
e7a6b91a 1066 'name' => 'received_date',
c3fc2621 1067 'field' => [
e7a6b91a 1068 0 => 'receive_date',
c3fc2621
CW
1069 ],
1070 'localizable' => FALSE,
e7a6b91a 1071 'sig' => 'civicrm_contribution::0::receive_date',
c3fc2621
CW
1072 ],
1073 'check_number' => [
e7a6b91a 1074 'name' => 'check_number',
c3fc2621 1075 'field' => [
e7a6b91a 1076 0 => 'check_number',
c3fc2621
CW
1077 ],
1078 'localizable' => FALSE,
e7a6b91a 1079 'sig' => 'civicrm_contribution::0::check_number',
c3fc2621
CW
1080 ],
1081 'index_creditnote_id' => [
e7a6b91a 1082 'name' => 'index_creditnote_id',
c3fc2621 1083 'field' => [
e7a6b91a 1084 0 => 'creditnote_id',
c3fc2621
CW
1085 ],
1086 'localizable' => FALSE,
e7a6b91a 1087 'sig' => 'civicrm_contribution::0::creditnote_id',
c3fc2621
CW
1088 ],
1089 ];
e7a6b91a
AS
1090 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
1091 }
c3fc2621 1092
e501603b 1093}