5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Contribute/Contribution.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:600b0cd019cba16cd62aae7463beab77)
13 * Database access object for the Contribution entity.
15 class CRM_Contribute_DAO_Contribution
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.3';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_contribution';
27 * Icon associated with this entity.
31 public static $_icon = 'fa-credit-card';
34 * Should CiviCRM log any modifications to this table in the civicrm_log table.
38 public static $_log = TRUE;
41 * Paths for accessing this entity in the UI.
45 protected static $_paths = [
46 'add' => 'civicrm/contribute/add?reset=1&action=add&context=standalone',
47 'view' => 'civicrm/contact/view/contribution?reset=1&action=view&id=[id]',
48 'update' => 'civicrm/contact/view/contribution?reset=1&action=update&id=[id]',
49 'delete' => 'civicrm/contact/view/contribution?reset=1&action=delete&id=[id]',
67 * FK to Financial Type for (total_amount - non_deductible_amount).
71 public $financial_type_id;
74 * The Contribution Page which triggered this contribution
78 public $contribution_page_id;
81 * FK to Payment Instrument
85 public $payment_instrument_id;
88 * Date contribution was received - not necessarily the creation date of the record
95 * Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types.
99 public $non_deductible_amount;
102 * Total amount of this contribution. Use market value for non-monetary gifts.
106 public $total_amount;
109 * actual processor fee if known - may be 0.
116 * actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.
123 * unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method
130 * unique invoice id, system generated or passed in
137 * Human readable invoice number
141 public $invoice_number;
144 * 3 character string, value from config setting or input via user.
151 * when was gift cancelled
160 public $cancel_reason;
163 * when (if) receipt was sent. populated automatically for online donations w/ automatic receipting
167 public $receipt_date;
170 * when (if) was donor thanked
174 public $thankyou_date;
177 * Origin of this Contribution.
186 public $amount_level;
189 * 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.
193 public $contribution_recur_id;
203 public $is_pay_later;
208 public $contribution_status_id;
211 * Conditional foreign key to civicrm_address.id. We insert an address record for each contribution when we have associated billing name and address data.
220 public $check_number;
223 * The campaign for which this contribution has been triggered.
230 * unique credit note id, system generated or passed in
234 public $creditnote_id;
237 * Total tax amount of this contribution.
244 * Stores the date when revenue should be recognized.
248 public $revenue_recognition_date;
251 * Shows this is a template for recurring contributions.
260 public function __construct() {
261 $this->__table
= 'civicrm_contribution';
262 parent
::__construct();
266 * Returns localized title of this entity.
268 * @param bool $plural
269 * Whether to return the plural version of the title.
271 public static function getEntityTitle($plural = FALSE) {
272 return $plural ?
ts('Contributions') : ts('Contribution');
276 * Returns foreign keys and entity references.
279 * [CRM_Core_Reference_Interface]
281 public static function getReferenceColumns() {
282 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
283 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
284 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
285 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'financial_type_id', 'civicrm_financial_type', 'id');
286 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contribution_page_id', 'civicrm_contribution_page', 'id');
287 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contribution_recur_id', 'civicrm_contribution_recur', 'id');
288 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'address_id', 'civicrm_address', 'id');
289 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'campaign_id', 'civicrm_campaign', 'id');
290 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
292 return Civi
::$statics[__CLASS__
]['links'];
296 * Returns all the column names of this table
300 public static function &fields() {
301 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
302 Civi
::$statics[__CLASS__
]['fields'] = [
303 'contribution_id' => [
305 'type' => CRM_Utils_Type
::T_INT
,
306 'title' => ts('Contribution ID'),
307 'description' => ts('Contribution ID'),
310 'where' => 'civicrm_contribution.id',
312 'table_name' => 'civicrm_contribution',
313 'entity' => 'Contribution',
314 'bao' => 'CRM_Contribute_BAO_Contribution',
321 'contribution_contact_id' => [
322 'name' => 'contact_id',
323 'type' => CRM_Utils_Type
::T_INT
,
324 'title' => ts('Contact ID'),
325 'description' => ts('FK to Contact ID'),
328 'where' => 'civicrm_contribution.contact_id',
329 'headerPattern' => '/contact(.?id)?/i',
330 'dataPattern' => '/^\d+$/',
332 'table_name' => 'civicrm_contribution',
333 'entity' => 'Contribution',
334 'bao' => 'CRM_Contribute_BAO_Contribution',
336 'FKClassName' => 'CRM_Contact_DAO_Contact',
338 'type' => 'EntityRef',
342 'financial_type_id' => [
343 'name' => 'financial_type_id',
344 'type' => CRM_Utils_Type
::T_INT
,
345 'title' => ts('Financial Type ID'),
346 'description' => ts('FK to Financial Type for (total_amount - non_deductible_amount).'),
347 'where' => 'civicrm_contribution.financial_type_id',
349 'table_name' => 'civicrm_contribution',
350 'entity' => 'Contribution',
351 'bao' => 'CRM_Contribute_BAO_Contribution',
353 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
356 'label' => ts("Financial Type"),
358 'pseudoconstant' => [
359 'table' => 'civicrm_financial_type',
361 'labelColumn' => 'name',
365 'contribution_page_id' => [
366 'name' => 'contribution_page_id',
367 'type' => CRM_Utils_Type
::T_INT
,
368 'title' => ts('Contribution Page ID'),
369 'description' => ts('The Contribution Page which triggered this contribution'),
371 'where' => 'civicrm_contribution.contribution_page_id',
373 'table_name' => 'civicrm_contribution',
374 'entity' => 'Contribution',
375 'bao' => 'CRM_Contribute_BAO_Contribution',
377 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
380 'label' => ts("Contribution Page"),
382 'pseudoconstant' => [
383 'table' => 'civicrm_contribution_page',
385 'labelColumn' => 'title',
389 'payment_instrument_id' => [
390 'name' => 'payment_instrument_id',
391 'type' => CRM_Utils_Type
::T_INT
,
392 'title' => ts('Payment Method ID'),
393 'description' => ts('FK to Payment Instrument'),
394 'where' => 'civicrm_contribution.payment_instrument_id',
395 'headerPattern' => '/^payment|(p(ayment\s)?instrument)$/i',
397 'table_name' => 'civicrm_contribution',
398 'entity' => 'Contribution',
399 'bao' => 'CRM_Contribute_BAO_Contribution',
404 'pseudoconstant' => [
405 'optionGroupName' => 'payment_instrument',
406 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
411 'name' => 'receive_date',
412 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
413 'title' => ts('Date Received'),
414 'description' => ts('Date contribution was received - not necessarily the creation date of the record'),
416 'where' => 'civicrm_contribution.receive_date',
417 'headerPattern' => '/receive(.?date)?/i',
418 'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
420 'table_name' => 'civicrm_contribution',
421 'entity' => 'Contribution',
422 'bao' => 'CRM_Contribute_BAO_Contribution',
425 'type' => 'Select Date',
426 'formatType' => 'activityDateTime',
430 'non_deductible_amount' => [
431 'name' => 'non_deductible_amount',
432 'type' => CRM_Utils_Type
::T_MONEY
,
433 'title' => ts('Non-deductible Amount'),
434 'description' => ts('Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types.'),
440 'where' => 'civicrm_contribution.non_deductible_amount',
441 'headerPattern' => '/non?.?deduct/i',
442 'dataPattern' => '/^\d+(\.\d{2})?$/',
445 'table_name' => 'civicrm_contribution',
446 'entity' => 'Contribution',
447 'bao' => 'CRM_Contribute_BAO_Contribution',
455 'name' => 'total_amount',
456 'type' => CRM_Utils_Type
::T_MONEY
,
457 'title' => ts('Total Amount'),
458 'description' => ts('Total amount of this contribution. Use market value for non-monetary gifts.'),
465 'where' => 'civicrm_contribution.total_amount',
466 'headerPattern' => '/^total|(.?^am(ou)?nt)/i',
467 'dataPattern' => '/^\d+(\.\d{2})?$/',
469 'table_name' => 'civicrm_contribution',
470 'entity' => 'Contribution',
471 'bao' => 'CRM_Contribute_BAO_Contribution',
479 'name' => 'fee_amount',
480 'type' => CRM_Utils_Type
::T_MONEY
,
481 'title' => ts('Fee Amount'),
482 'description' => ts('actual processor fee if known - may be 0.'),
488 'where' => 'civicrm_contribution.fee_amount',
489 'headerPattern' => '/fee(.?am(ou)?nt)?/i',
490 'dataPattern' => '/^\d+(\.\d{2})?$/',
492 'table_name' => 'civicrm_contribution',
493 'entity' => 'Contribution',
494 'bao' => 'CRM_Contribute_BAO_Contribution',
502 'name' => 'net_amount',
503 'type' => CRM_Utils_Type
::T_MONEY
,
504 'title' => ts('Net Amount'),
505 'description' => ts('actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.'),
511 'where' => 'civicrm_contribution.net_amount',
512 'headerPattern' => '/net(.?am(ou)?nt)?/i',
513 'dataPattern' => '/^\d+(\.\d{2})?$/',
515 'table_name' => 'civicrm_contribution',
516 'entity' => 'Contribution',
517 'bao' => 'CRM_Contribute_BAO_Contribution',
526 'type' => CRM_Utils_Type
::T_STRING
,
527 'title' => ts('Transaction ID'),
528 'description' => ts('unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method'),
530 'size' => CRM_Utils_Type
::HUGE
,
532 'where' => 'civicrm_contribution.trxn_id',
533 'headerPattern' => '/tr(ansactio|x)n(.?id)?/i',
535 'table_name' => 'civicrm_contribution',
536 'entity' => 'Contribution',
537 'bao' => 'CRM_Contribute_BAO_Contribution',
545 'name' => 'invoice_id',
546 'type' => CRM_Utils_Type
::T_STRING
,
547 'title' => ts('Invoice Reference'),
548 'description' => ts('unique invoice id, system generated or passed in'),
550 'size' => CRM_Utils_Type
::HUGE
,
552 'where' => 'civicrm_contribution.invoice_id',
553 'headerPattern' => '/invoice(.?id)?/i',
555 'table_name' => 'civicrm_contribution',
556 'entity' => 'Contribution',
557 'bao' => 'CRM_Contribute_BAO_Contribution',
564 'invoice_number' => [
565 'name' => 'invoice_number',
566 'type' => CRM_Utils_Type
::T_STRING
,
567 'title' => ts('Invoice Number'),
568 'description' => ts('Human readable invoice number'),
570 'size' => CRM_Utils_Type
::HUGE
,
572 'where' => 'civicrm_contribution.invoice_number',
573 'headerPattern' => '/invoice(.?number)?/i',
575 'table_name' => 'civicrm_contribution',
576 'entity' => 'Contribution',
577 'bao' => 'CRM_Contribute_BAO_Contribution',
585 'name' => 'currency',
586 'type' => CRM_Utils_Type
::T_STRING
,
587 'title' => ts('Currency'),
588 'description' => ts('3 character string, value from config setting or input via user.'),
590 'size' => CRM_Utils_Type
::FOUR
,
592 'where' => 'civicrm_contribution.currency',
593 'headerPattern' => '/cur(rency)?/i',
594 'dataPattern' => '/^[A-Z]{3}$/i',
597 'table_name' => 'civicrm_contribution',
598 'entity' => 'Contribution',
599 'bao' => 'CRM_Contribute_BAO_Contribution',
604 'pseudoconstant' => [
605 'table' => 'civicrm_currency',
606 'keyColumn' => 'name',
607 'labelColumn' => 'full_name',
608 'nameColumn' => 'name',
609 'abbrColumn' => 'symbol',
613 'contribution_cancel_date' => [
614 'name' => 'cancel_date',
615 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
616 'title' => ts('Cancelled / Refunded Date'),
617 'description' => ts('when was gift cancelled'),
619 'where' => 'civicrm_contribution.cancel_date',
620 'headerPattern' => '/cancel(.?date)?/i',
621 'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
623 'table_name' => 'civicrm_contribution',
624 'entity' => 'Contribution',
625 'bao' => 'CRM_Contribute_BAO_Contribution',
628 'type' => 'Select Date',
629 'formatType' => 'activityDateTime',
634 'name' => 'cancel_reason',
635 'type' => CRM_Utils_Type
::T_TEXT
,
636 'title' => ts('Cancellation / Refund Reason'),
638 'where' => 'civicrm_contribution.cancel_reason',
639 'headerPattern' => '/(cancel.?)?reason/i',
641 'table_name' => 'civicrm_contribution',
642 'entity' => 'Contribution',
643 'bao' => 'CRM_Contribute_BAO_Contribution',
651 'name' => 'receipt_date',
652 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
653 'title' => ts('Receipt Date'),
654 'description' => ts('when (if) receipt was sent. populated automatically for online donations w/ automatic receipting'),
656 'where' => 'civicrm_contribution.receipt_date',
657 'headerPattern' => '/receipt(.?date)?/i',
658 'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
660 'table_name' => 'civicrm_contribution',
661 'entity' => 'Contribution',
662 'bao' => 'CRM_Contribute_BAO_Contribution',
665 'type' => 'Select Date',
666 'formatType' => 'activityDateTime',
671 'name' => 'thankyou_date',
672 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
673 'title' => ts('Thank-you Date'),
674 'description' => ts('when (if) was donor thanked'),
676 'where' => 'civicrm_contribution.thankyou_date',
677 'headerPattern' => '/thank(s|(.?you))?(.?date)?/i',
678 'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
680 'table_name' => 'civicrm_contribution',
681 'entity' => 'Contribution',
682 'bao' => 'CRM_Contribute_BAO_Contribution',
685 'type' => 'Select Date',
686 'formatType' => 'activityDateTime',
690 'contribution_source' => [
692 'type' => CRM_Utils_Type
::T_STRING
,
693 'title' => ts('Contribution Source'),
694 'description' => ts('Origin of this Contribution.'),
696 'size' => CRM_Utils_Type
::HUGE
,
698 'where' => 'civicrm_contribution.source',
699 'headerPattern' => '/source/i',
701 'table_name' => 'civicrm_contribution',
702 'entity' => 'Contribution',
703 'bao' => 'CRM_Contribute_BAO_Contribution',
711 'name' => 'amount_level',
712 'type' => CRM_Utils_Type
::T_TEXT
,
713 'title' => ts('Amount Label'),
715 'where' => 'civicrm_contribution.amount_level',
717 'table_name' => 'civicrm_contribution',
718 'entity' => 'Contribution',
719 'bao' => 'CRM_Contribute_BAO_Contribution',
726 'contribution_recur_id' => [
727 'name' => 'contribution_recur_id',
728 'type' => CRM_Utils_Type
::T_INT
,
729 'title' => ts('Recurring Contribution ID'),
730 '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.'),
731 'where' => 'civicrm_contribution.contribution_recur_id',
733 'table_name' => 'civicrm_contribution',
734 'entity' => 'Contribution',
735 'bao' => 'CRM_Contribute_BAO_Contribution',
737 'FKClassName' => 'CRM_Contribute_DAO_ContributionRecur',
742 'type' => CRM_Utils_Type
::T_BOOLEAN
,
743 'title' => ts('Test'),
745 'where' => 'civicrm_contribution.is_test',
748 'table_name' => 'civicrm_contribution',
749 'entity' => 'Contribution',
750 'bao' => 'CRM_Contribute_BAO_Contribution',
753 'type' => 'CheckBox',
758 'name' => 'is_pay_later',
759 'type' => CRM_Utils_Type
::T_BOOLEAN
,
760 'title' => ts('Is Pay Later'),
762 'where' => 'civicrm_contribution.is_pay_later',
765 'table_name' => 'civicrm_contribution',
766 'entity' => 'Contribution',
767 'bao' => 'CRM_Contribute_BAO_Contribution',
770 'type' => 'CheckBox',
774 'contribution_status_id' => [
775 'name' => 'contribution_status_id',
776 'type' => CRM_Utils_Type
::T_INT
,
777 'title' => ts('Contribution Status ID'),
779 'where' => 'civicrm_contribution.contribution_status_id',
780 'headerPattern' => '/status/i',
783 'table_name' => 'civicrm_contribution',
784 'entity' => 'Contribution',
785 'bao' => 'CRM_Contribute_BAO_Contribution',
790 'pseudoconstant' => [
791 'optionGroupName' => 'contribution_status',
792 'optionEditPath' => 'civicrm/admin/options/contribution_status',
796 'contribution_address_id' => [
797 'name' => 'address_id',
798 'type' => CRM_Utils_Type
::T_INT
,
799 'title' => ts('Contribution Address'),
800 '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.'),
801 'where' => 'civicrm_contribution.address_id',
803 'table_name' => 'civicrm_contribution',
804 'entity' => 'Contribution',
805 'bao' => 'CRM_Contribute_BAO_Contribution',
807 'FKClassName' => 'CRM_Core_DAO_Address',
810 'contribution_check_number' => [
811 'name' => 'check_number',
812 'type' => CRM_Utils_Type
::T_STRING
,
813 'title' => ts('Check Number'),
817 'where' => 'civicrm_contribution.check_number',
818 'headerPattern' => '/check(.?number)?/i',
820 'table_name' => 'civicrm_contribution',
821 'entity' => 'Contribution',
822 'bao' => 'CRM_Contribute_BAO_Contribution',
829 'contribution_campaign_id' => [
830 'name' => 'campaign_id',
831 'type' => CRM_Utils_Type
::T_INT
,
832 'title' => ts('Campaign'),
833 'description' => ts('The campaign for which this contribution has been triggered.'),
835 'where' => 'civicrm_contribution.campaign_id',
837 'table_name' => 'civicrm_contribution',
838 'entity' => 'Contribution',
839 'bao' => 'CRM_Contribute_BAO_Contribution',
841 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
845 'pseudoconstant' => [
846 'table' => 'civicrm_campaign',
848 'labelColumn' => 'title',
853 'name' => 'creditnote_id',
854 'type' => CRM_Utils_Type
::T_STRING
,
855 'title' => ts('Credit Note ID'),
856 'description' => ts('unique credit note id, system generated or passed in'),
858 'size' => CRM_Utils_Type
::HUGE
,
860 'where' => 'civicrm_contribution.creditnote_id',
861 'headerPattern' => '/creditnote(.?id)?/i',
863 'table_name' => 'civicrm_contribution',
864 'entity' => 'Contribution',
865 'bao' => 'CRM_Contribute_BAO_Contribution',
873 'name' => 'tax_amount',
874 'type' => CRM_Utils_Type
::T_MONEY
,
875 'title' => ts('Tax Amount'),
876 'description' => ts('Total tax amount of this contribution.'),
882 'where' => 'civicrm_contribution.tax_amount',
883 'headerPattern' => '/tax(.?am(ou)?nt)?/i',
884 'dataPattern' => '/^\d+(\.\d{2})?$/',
886 'table_name' => 'civicrm_contribution',
887 'entity' => 'Contribution',
888 'bao' => 'CRM_Contribute_BAO_Contribution',
895 'revenue_recognition_date' => [
896 'name' => 'revenue_recognition_date',
897 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
898 'title' => ts('Revenue Recognition Date'),
899 'description' => ts('Stores the date when revenue should be recognized.'),
901 'where' => 'civicrm_contribution.revenue_recognition_date',
902 'headerPattern' => '/revenue(.?date)?/i',
903 'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
905 'table_name' => 'civicrm_contribution',
906 'entity' => 'Contribution',
907 'bao' => 'CRM_Contribute_BAO_Contribution',
910 'type' => 'Select Date',
911 'formatType' => 'activityDateTime',
916 'name' => 'is_template',
917 'type' => CRM_Utils_Type
::T_BOOLEAN
,
918 'title' => ts('Is a Template Contribution'),
919 'description' => ts('Shows this is a template for recurring contributions.'),
921 'where' => 'civicrm_contribution.is_template',
924 'table_name' => 'civicrm_contribution',
925 'entity' => 'Contribution',
926 'bao' => 'CRM_Contribute_BAO_Contribution',
929 'type' => 'CheckBox',
934 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
936 return Civi
::$statics[__CLASS__
]['fields'];
940 * Return a mapping from field-name to the corresponding key (as used in fields()).
943 * Array(string $name => string $uniqueName).
945 public static function &fieldKeys() {
946 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
947 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
949 return Civi
::$statics[__CLASS__
]['fieldKeys'];
953 * Returns the names of this table
957 public static function getTableName() {
958 return self
::$_tableName;
962 * Returns if this table needs to be logged
966 public function getLog() {
971 * Returns the list of fields that can be imported
973 * @param bool $prefix
977 public static function &import($prefix = FALSE) {
978 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution', $prefix, []);
983 * Returns the list of fields that can be exported
985 * @param bool $prefix
989 public static function &export($prefix = FALSE) {
990 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution', $prefix, []);
995 * Returns the list of indices
997 * @param bool $localize
1001 public static function indices($localize = TRUE) {
1003 'UI_contrib_payment_instrument_id' => [
1004 'name' => 'UI_contrib_payment_instrument_id',
1006 0 => 'payment_instrument_id',
1008 'localizable' => FALSE,
1009 'sig' => 'civicrm_contribution::0::payment_instrument_id',
1011 'index_total_amount_receive_date' => [
1012 'name' => 'index_total_amount_receive_date',
1014 0 => 'total_amount',
1015 1 => 'receive_date',
1017 'localizable' => FALSE,
1018 'sig' => 'civicrm_contribution::0::total_amount::receive_date',
1021 'name' => 'index_source',
1025 'localizable' => FALSE,
1026 'sig' => 'civicrm_contribution::0::source',
1028 'UI_contrib_trxn_id' => [
1029 'name' => 'UI_contrib_trxn_id',
1033 'localizable' => FALSE,
1035 'sig' => 'civicrm_contribution::1::trxn_id',
1037 'UI_contrib_invoice_id' => [
1038 'name' => 'UI_contrib_invoice_id',
1042 'localizable' => FALSE,
1044 'sig' => 'civicrm_contribution::1::invoice_id',
1046 'index_contribution_status' => [
1047 'name' => 'index_contribution_status',
1049 0 => 'contribution_status_id',
1051 'localizable' => FALSE,
1052 'sig' => 'civicrm_contribution::0::contribution_status_id',
1054 'received_date' => [
1055 'name' => 'received_date',
1057 0 => 'receive_date',
1059 'localizable' => FALSE,
1060 'sig' => 'civicrm_contribution::0::receive_date',
1063 'name' => 'check_number',
1065 0 => 'check_number',
1067 'localizable' => FALSE,
1068 'sig' => 'civicrm_contribution::0::check_number',
1070 'index_creditnote_id' => [
1071 'name' => 'index_creditnote_id',
1073 0 => 'creditnote_id',
1075 'localizable' => FALSE,
1076 'sig' => 'civicrm_contribution::0::creditnote_id',
1079 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;