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:92fe08f4921e963467ae0d3ae05777ac)
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';
18 const COMPONENT
= 'CiviContribute';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_contribution';
28 * Icon associated with this entity.
32 public static $_icon = 'fa-credit-card';
35 * Should CiviCRM log any modifications to this table in the civicrm_log table.
39 public static $_log = TRUE;
42 * Paths for accessing this entity in the UI.
46 protected static $_paths = [
47 'add' => 'civicrm/contribute/add?reset=1&action=add&context=standalone',
48 'view' => 'civicrm/contact/view/contribution?reset=1&action=view&id=[id]',
49 'update' => 'civicrm/contact/view/contribution?reset=1&action=update&id=[id]',
50 'delete' => 'civicrm/contact/view/contribution?reset=1&action=delete&id=[id]',
68 * FK to Financial Type for (total_amount - non_deductible_amount).
72 public $financial_type_id;
75 * The Contribution Page which triggered this contribution
79 public $contribution_page_id;
82 * FK to Payment Instrument
86 public $payment_instrument_id;
89 * Date contribution was received - not necessarily the creation date of the record
96 * Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types.
100 public $non_deductible_amount;
103 * Total amount of this contribution. Use market value for non-monetary gifts.
107 public $total_amount;
110 * actual processor fee if known - may be 0.
117 * actual funds transfer amount. total less fees. if processor does not report actual fee during transaction, this is set to total_amount.
124 * unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method
131 * unique invoice id, system generated or passed in
138 * Human readable invoice number
142 public $invoice_number;
145 * 3 character string, value from config setting or input via user.
152 * when was gift cancelled
161 public $cancel_reason;
164 * when (if) receipt was sent. populated automatically for online donations w/ automatic receipting
168 public $receipt_date;
171 * when (if) was donor thanked
175 public $thankyou_date;
178 * Origin of this Contribution.
187 public $amount_level;
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.
194 public $contribution_recur_id;
204 public $is_pay_later;
209 public $contribution_status_id;
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.
221 public $check_number;
224 * The campaign for which this contribution has been triggered.
231 * unique credit note id, system generated or passed in
235 public $creditnote_id;
238 * Total tax amount of this contribution.
245 * Stores the date when revenue should be recognized.
249 public $revenue_recognition_date;
252 * Shows this is a template for recurring contributions.
261 public function __construct() {
262 $this->__table
= 'civicrm_contribution';
263 parent
::__construct();
267 * Returns localized title of this entity.
269 * @param bool $plural
270 * Whether to return the plural version of the title.
272 public static function getEntityTitle($plural = FALSE) {
273 return $plural ?
ts('Contributions') : ts('Contribution');
277 * Returns foreign keys and entity references.
280 * [CRM_Core_Reference_Interface]
282 public static function getReferenceColumns() {
283 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
284 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
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');
291 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
293 return Civi
::$statics[__CLASS__
]['links'];
297 * Returns all the column names of this table
301 public static function &fields() {
302 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
303 Civi
::$statics[__CLASS__
]['fields'] = [
304 'contribution_id' => [
306 'type' => CRM_Utils_Type
::T_INT
,
307 'title' => ts('Contribution ID'),
308 'description' => ts('Contribution ID'),
311 'where' => 'civicrm_contribution.id',
313 'table_name' => 'civicrm_contribution',
314 'entity' => 'Contribution',
315 'bao' => 'CRM_Contribute_BAO_Contribution',
323 'contribution_contact_id' => [
324 'name' => 'contact_id',
325 'type' => CRM_Utils_Type
::T_INT
,
326 'title' => ts('Contact ID'),
327 'description' => ts('FK to Contact ID'),
330 'where' => 'civicrm_contribution.contact_id',
331 'headerPattern' => '/contact(.?id)?/i',
332 'dataPattern' => '/^\d+$/',
334 'table_name' => 'civicrm_contribution',
335 'entity' => 'Contribution',
336 'bao' => 'CRM_Contribute_BAO_Contribution',
338 'FKClassName' => 'CRM_Contact_DAO_Contact',
340 'type' => 'EntityRef',
341 'label' => ts("Contact"),
345 'financial_type_id' => [
346 'name' => 'financial_type_id',
347 'type' => CRM_Utils_Type
::T_INT
,
348 'title' => ts('Financial Type ID'),
349 'description' => ts('FK to Financial Type for (total_amount - non_deductible_amount).'),
350 'where' => 'civicrm_contribution.financial_type_id',
352 'table_name' => 'civicrm_contribution',
353 'entity' => 'Contribution',
354 'bao' => 'CRM_Contribute_BAO_Contribution',
356 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
359 'label' => ts("Financial Type"),
361 'pseudoconstant' => [
362 'table' => 'civicrm_financial_type',
364 'labelColumn' => 'name',
368 'contribution_page_id' => [
369 'name' => 'contribution_page_id',
370 'type' => CRM_Utils_Type
::T_INT
,
371 'title' => ts('Contribution Page ID'),
372 'description' => ts('The Contribution Page which triggered this contribution'),
374 'where' => 'civicrm_contribution.contribution_page_id',
376 'table_name' => 'civicrm_contribution',
377 'entity' => 'Contribution',
378 'bao' => 'CRM_Contribute_BAO_Contribution',
380 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
383 'label' => ts("Contribution Page"),
385 'pseudoconstant' => [
386 'table' => 'civicrm_contribution_page',
388 'labelColumn' => 'title',
392 'payment_instrument_id' => [
393 'name' => 'payment_instrument_id',
394 'type' => CRM_Utils_Type
::T_INT
,
395 'title' => ts('Payment Method ID'),
396 'description' => ts('FK to Payment Instrument'),
397 'where' => 'civicrm_contribution.payment_instrument_id',
398 'headerPattern' => '/^payment|(p(ayment\s)?instrument)$/i',
400 'table_name' => 'civicrm_contribution',
401 'entity' => 'Contribution',
402 'bao' => 'CRM_Contribute_BAO_Contribution',
407 'pseudoconstant' => [
408 'optionGroupName' => 'payment_instrument',
409 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
414 'name' => 'receive_date',
415 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
416 'title' => ts('Date Received'),
417 'description' => ts('Date contribution was received - not necessarily the creation date of the record'),
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})?)?$/',
423 'table_name' => 'civicrm_contribution',
424 'entity' => 'Contribution',
425 'bao' => 'CRM_Contribute_BAO_Contribution',
428 'type' => 'Select Date',
429 'formatType' => 'activityDateTime',
433 'non_deductible_amount' => [
434 'name' => 'non_deductible_amount',
435 'type' => CRM_Utils_Type
::T_MONEY
,
436 'title' => ts('Non-deductible Amount'),
437 'description' => ts('Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types.'),
443 'where' => 'civicrm_contribution.non_deductible_amount',
444 'headerPattern' => '/non?.?deduct/i',
445 'dataPattern' => '/^\d+(\.\d{2})?$/',
448 'table_name' => 'civicrm_contribution',
449 'entity' => 'Contribution',
450 'bao' => 'CRM_Contribute_BAO_Contribution',
458 'name' => 'total_amount',
459 'type' => CRM_Utils_Type
::T_MONEY
,
460 'title' => ts('Total Amount'),
461 'description' => ts('Total amount of this contribution. Use market value for non-monetary gifts.'),
468 'where' => 'civicrm_contribution.total_amount',
469 'headerPattern' => '/^total|(.?^am(ou)?nt)/i',
470 'dataPattern' => '/^\d+(\.\d{2})?$/',
472 'table_name' => 'civicrm_contribution',
473 'entity' => 'Contribution',
474 'bao' => 'CRM_Contribute_BAO_Contribution',
478 'label' => ts("Total Amount"),
483 'name' => 'fee_amount',
484 'type' => CRM_Utils_Type
::T_MONEY
,
485 'title' => ts('Fee Amount'),
486 'description' => ts('actual processor fee if known - may be 0.'),
492 'where' => 'civicrm_contribution.fee_amount',
493 'headerPattern' => '/fee(.?am(ou)?nt)?/i',
494 'dataPattern' => '/^\d+(\.\d{2})?$/',
496 'table_name' => 'civicrm_contribution',
497 'entity' => 'Contribution',
498 'bao' => 'CRM_Contribute_BAO_Contribution',
502 'label' => ts("Fee Amount"),
507 'name' => 'net_amount',
508 'type' => CRM_Utils_Type
::T_MONEY
,
509 'title' => ts('Net Amount'),
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.'),
516 'where' => 'civicrm_contribution.net_amount',
517 'headerPattern' => '/net(.?am(ou)?nt)?/i',
518 'dataPattern' => '/^\d+(\.\d{2})?$/',
520 'table_name' => 'civicrm_contribution',
521 'entity' => 'Contribution',
522 'bao' => 'CRM_Contribute_BAO_Contribution',
526 'label' => ts("Net Amount"),
532 'type' => CRM_Utils_Type
::T_STRING
,
533 'title' => ts('Transaction ID'),
534 'description' => ts('unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method'),
536 'size' => CRM_Utils_Type
::HUGE
,
538 'where' => 'civicrm_contribution.trxn_id',
539 'headerPattern' => '/tr(ansactio|x)n(.?id)?/i',
541 'table_name' => 'civicrm_contribution',
542 'entity' => 'Contribution',
543 'bao' => 'CRM_Contribute_BAO_Contribution',
551 'name' => 'invoice_id',
552 'type' => CRM_Utils_Type
::T_STRING
,
553 'title' => ts('Invoice Reference'),
554 'description' => ts('unique invoice id, system generated or passed in'),
556 'size' => CRM_Utils_Type
::HUGE
,
558 'where' => 'civicrm_contribution.invoice_id',
559 'headerPattern' => '/invoice(.?id)?/i',
561 'table_name' => 'civicrm_contribution',
562 'entity' => 'Contribution',
563 'bao' => 'CRM_Contribute_BAO_Contribution',
570 'invoice_number' => [
571 'name' => 'invoice_number',
572 'type' => CRM_Utils_Type
::T_STRING
,
573 'title' => ts('Invoice Number'),
574 'description' => ts('Human readable invoice number'),
576 'size' => CRM_Utils_Type
::HUGE
,
578 'where' => 'civicrm_contribution.invoice_number',
579 'headerPattern' => '/invoice(.?number)?/i',
581 'table_name' => 'civicrm_contribution',
582 'entity' => 'Contribution',
583 'bao' => 'CRM_Contribute_BAO_Contribution',
591 'name' => 'currency',
592 'type' => CRM_Utils_Type
::T_STRING
,
593 'title' => ts('Currency'),
594 'description' => ts('3 character string, value from config setting or input via user.'),
596 'size' => CRM_Utils_Type
::FOUR
,
598 'where' => 'civicrm_contribution.currency',
599 'headerPattern' => '/cur(rency)?/i',
600 'dataPattern' => '/^[A-Z]{3}$/i',
603 'table_name' => 'civicrm_contribution',
604 'entity' => 'Contribution',
605 'bao' => 'CRM_Contribute_BAO_Contribution',
609 'label' => ts("Currency"),
611 'pseudoconstant' => [
612 'table' => 'civicrm_currency',
613 'keyColumn' => 'name',
614 'labelColumn' => 'full_name',
615 'nameColumn' => 'name',
616 'abbrColumn' => 'symbol',
620 'contribution_cancel_date' => [
621 'name' => 'cancel_date',
622 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
623 'title' => ts('Cancelled / Refunded Date'),
624 'description' => ts('when was gift cancelled'),
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})?)?$/',
630 'table_name' => 'civicrm_contribution',
631 'entity' => 'Contribution',
632 'bao' => 'CRM_Contribute_BAO_Contribution',
635 'type' => 'Select Date',
636 'formatType' => 'activityDateTime',
641 'name' => 'cancel_reason',
642 'type' => CRM_Utils_Type
::T_TEXT
,
643 'title' => ts('Cancellation / Refund Reason'),
645 'where' => 'civicrm_contribution.cancel_reason',
646 'headerPattern' => '/(cancel.?)?reason/i',
648 'table_name' => 'civicrm_contribution',
649 'entity' => 'Contribution',
650 'bao' => 'CRM_Contribute_BAO_Contribution',
658 'name' => 'receipt_date',
659 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
660 'title' => ts('Receipt Date'),
661 'description' => ts('when (if) receipt was sent. populated automatically for online donations w/ automatic receipting'),
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})?)?$/',
667 'table_name' => 'civicrm_contribution',
668 'entity' => 'Contribution',
669 'bao' => 'CRM_Contribute_BAO_Contribution',
672 'type' => 'Select Date',
673 'formatType' => 'activityDateTime',
674 'label' => ts("Receipt Date"),
679 'name' => 'thankyou_date',
680 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
681 'title' => ts('Thank-you Date'),
682 'description' => ts('when (if) was donor thanked'),
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})?)?$/',
688 'table_name' => 'civicrm_contribution',
689 'entity' => 'Contribution',
690 'bao' => 'CRM_Contribute_BAO_Contribution',
693 'type' => 'Select Date',
694 'formatType' => 'activityDateTime',
698 'contribution_source' => [
700 'type' => CRM_Utils_Type
::T_STRING
,
701 'title' => ts('Contribution Source'),
702 'description' => ts('Origin of this Contribution.'),
704 'size' => CRM_Utils_Type
::HUGE
,
706 'where' => 'civicrm_contribution.source',
707 'headerPattern' => '/source/i',
709 'table_name' => 'civicrm_contribution',
710 'entity' => 'Contribution',
711 'bao' => 'CRM_Contribute_BAO_Contribution',
719 'name' => 'amount_level',
720 'type' => CRM_Utils_Type
::T_TEXT
,
721 'title' => ts('Amount Label'),
723 'where' => 'civicrm_contribution.amount_level',
725 'table_name' => 'civicrm_contribution',
726 'entity' => 'Contribution',
727 'bao' => 'CRM_Contribute_BAO_Contribution',
734 'contribution_recur_id' => [
735 'name' => 'contribution_recur_id',
736 'type' => CRM_Utils_Type
::T_INT
,
737 'title' => ts('Recurring Contribution ID'),
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.'),
739 'where' => 'civicrm_contribution.contribution_recur_id',
741 'table_name' => 'civicrm_contribution',
742 'entity' => 'Contribution',
743 'bao' => 'CRM_Contribute_BAO_Contribution',
745 'FKClassName' => 'CRM_Contribute_DAO_ContributionRecur',
747 'label' => ts("Recurring Contribution"),
753 'type' => CRM_Utils_Type
::T_BOOLEAN
,
754 'title' => ts('Test'),
756 'where' => 'civicrm_contribution.is_test',
759 'table_name' => 'civicrm_contribution',
760 'entity' => 'Contribution',
761 'bao' => 'CRM_Contribute_BAO_Contribution',
764 'type' => 'CheckBox',
769 'name' => 'is_pay_later',
770 'type' => CRM_Utils_Type
::T_BOOLEAN
,
771 'title' => ts('Is Pay Later'),
773 'where' => 'civicrm_contribution.is_pay_later',
776 'table_name' => 'civicrm_contribution',
777 'entity' => 'Contribution',
778 'bao' => 'CRM_Contribute_BAO_Contribution',
781 'type' => 'CheckBox',
785 'contribution_status_id' => [
786 'name' => 'contribution_status_id',
787 'type' => CRM_Utils_Type
::T_INT
,
788 'title' => ts('Contribution Status ID'),
790 'where' => 'civicrm_contribution.contribution_status_id',
791 'headerPattern' => '/status/i',
794 'table_name' => 'civicrm_contribution',
795 'entity' => 'Contribution',
796 'bao' => 'CRM_Contribute_BAO_Contribution',
801 'pseudoconstant' => [
802 'optionGroupName' => 'contribution_status',
803 'optionEditPath' => 'civicrm/admin/options/contribution_status',
807 'contribution_address_id' => [
808 'name' => 'address_id',
809 'type' => CRM_Utils_Type
::T_INT
,
810 'title' => ts('Address ID'),
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.'),
812 'where' => 'civicrm_contribution.address_id',
814 'table_name' => 'civicrm_contribution',
815 'entity' => 'Contribution',
816 'bao' => 'CRM_Contribute_BAO_Contribution',
818 'FKClassName' => 'CRM_Core_DAO_Address',
820 'label' => ts("Address"),
824 'contribution_check_number' => [
825 'name' => 'check_number',
826 'type' => CRM_Utils_Type
::T_STRING
,
827 'title' => ts('Check Number'),
831 'where' => 'civicrm_contribution.check_number',
832 'headerPattern' => '/check(.?number)?/i',
834 'table_name' => 'civicrm_contribution',
835 'entity' => 'Contribution',
836 'bao' => 'CRM_Contribute_BAO_Contribution',
843 'contribution_campaign_id' => [
844 'name' => 'campaign_id',
845 'type' => CRM_Utils_Type
::T_INT
,
846 'title' => ts('Campaign ID'),
847 'description' => ts('The campaign for which this contribution has been triggered.'),
849 'where' => 'civicrm_contribution.campaign_id',
851 'table_name' => 'civicrm_contribution',
852 'entity' => 'Contribution',
853 'bao' => 'CRM_Contribute_BAO_Contribution',
855 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
858 'label' => ts("Campaign"),
863 'name' => 'creditnote_id',
864 'type' => CRM_Utils_Type
::T_STRING
,
865 'title' => ts('Credit Note ID'),
866 'description' => ts('unique credit note id, system generated or passed in'),
868 'size' => CRM_Utils_Type
::HUGE
,
870 'where' => 'civicrm_contribution.creditnote_id',
871 'headerPattern' => '/creditnote(.?id)?/i',
873 'table_name' => 'civicrm_contribution',
874 'entity' => 'Contribution',
875 'bao' => 'CRM_Contribute_BAO_Contribution',
883 'name' => 'tax_amount',
884 'type' => CRM_Utils_Type
::T_MONEY
,
885 'title' => ts('Tax Amount'),
886 'description' => ts('Total tax amount of this contribution.'),
892 'where' => 'civicrm_contribution.tax_amount',
893 'headerPattern' => '/tax(.?am(ou)?nt)?/i',
894 'dataPattern' => '/^\d+(\.\d{2})?$/',
896 'table_name' => 'civicrm_contribution',
897 'entity' => 'Contribution',
898 'bao' => 'CRM_Contribute_BAO_Contribution',
905 'revenue_recognition_date' => [
906 'name' => 'revenue_recognition_date',
907 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
908 'title' => ts('Revenue Recognition Date'),
909 'description' => ts('Stores the date when revenue should be recognized.'),
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})?)?$/',
915 'table_name' => 'civicrm_contribution',
916 'entity' => 'Contribution',
917 'bao' => 'CRM_Contribute_BAO_Contribution',
920 'type' => 'Select Date',
921 'formatType' => 'activityDateTime',
922 'label' => ts("Revenue Recognition Date"),
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.'),
932 'where' => 'civicrm_contribution.is_template',
935 'table_name' => 'civicrm_contribution',
936 'entity' => 'Contribution',
937 'bao' => 'CRM_Contribute_BAO_Contribution',
940 'type' => 'CheckBox',
945 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
947 return Civi
::$statics[__CLASS__
]['fields'];
951 * Return a mapping from field-name to the corresponding key (as used in fields()).
954 * Array(string $name => string $uniqueName).
956 public static function &fieldKeys() {
957 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
958 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
960 return Civi
::$statics[__CLASS__
]['fieldKeys'];
964 * Returns the names of this table
968 public static function getTableName() {
969 return self
::$_tableName;
973 * Returns if this table needs to be logged
977 public function getLog() {
982 * Returns the list of fields that can be imported
984 * @param bool $prefix
988 public static function &import($prefix = FALSE) {
989 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution', $prefix, []);
994 * Returns the list of fields that can be exported
996 * @param bool $prefix
1000 public static function &export($prefix = FALSE) {
1001 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution', $prefix, []);
1006 * Returns the list of indices
1008 * @param bool $localize
1012 public static function indices($localize = TRUE) {
1014 'UI_contrib_payment_instrument_id' => [
1015 'name' => 'UI_contrib_payment_instrument_id',
1017 0 => 'payment_instrument_id',
1019 'localizable' => FALSE,
1020 'sig' => 'civicrm_contribution::0::payment_instrument_id',
1022 'index_total_amount_receive_date' => [
1023 'name' => 'index_total_amount_receive_date',
1025 0 => 'total_amount',
1026 1 => 'receive_date',
1028 'localizable' => FALSE,
1029 'sig' => 'civicrm_contribution::0::total_amount::receive_date',
1032 'name' => 'index_source',
1036 'localizable' => FALSE,
1037 'sig' => 'civicrm_contribution::0::source',
1039 'UI_contrib_trxn_id' => [
1040 'name' => 'UI_contrib_trxn_id',
1044 'localizable' => FALSE,
1046 'sig' => 'civicrm_contribution::1::trxn_id',
1048 'UI_contrib_invoice_id' => [
1049 'name' => 'UI_contrib_invoice_id',
1053 'localizable' => FALSE,
1055 'sig' => 'civicrm_contribution::1::invoice_id',
1057 'index_contribution_status' => [
1058 'name' => 'index_contribution_status',
1060 0 => 'contribution_status_id',
1062 'localizable' => FALSE,
1063 'sig' => 'civicrm_contribution::0::contribution_status_id',
1065 'received_date' => [
1066 'name' => 'received_date',
1068 0 => 'receive_date',
1070 'localizable' => FALSE,
1071 'sig' => 'civicrm_contribution::0::receive_date',
1074 'name' => 'check_number',
1076 0 => 'check_number',
1078 'localizable' => FALSE,
1079 'sig' => 'civicrm_contribution::0::check_number',
1081 'index_creditnote_id' => [
1082 'name' => 'index_creditnote_id',
1084 0 => 'creditnote_id',
1086 'localizable' => FALSE,
1087 'sig' => 'civicrm_contribution::0::creditnote_id',
1090 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;