5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Contribute/ContributionRecur.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:caadace3dd39c9bcc5f340bd9ff4da95)
13 * Database access object for the ContributionRecur entity.
15 class CRM_Contribute_DAO_ContributionRecur
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.6';
18 const COMPONENT
= 'CiviContribute';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_contribution_recur';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = TRUE;
35 * Contribution Recur ID
37 * @var int|string|null
38 * (SQL type: int unsigned)
39 * Note that values will be retrieved from the database as a string.
44 * Foreign key to civicrm_contact.id.
47 * (SQL type: int unsigned)
48 * Note that values will be retrieved from the database as a string.
53 * Amount to be collected (including any sales tax) by payment processor each recurrence.
56 * (SQL type: decimal(20,2))
57 * Note that values will be retrieved from the database as a string.
62 * 3 character string, value from config setting or input via user.
65 * (SQL type: varchar(3))
66 * Note that values will be retrieved from the database as a string.
71 * Time units for recurrence of payment.
74 * (SQL type: varchar(8))
75 * Note that values will be retrieved from the database as a string.
77 public $frequency_unit;
80 * Number of time units for recurrence of payment.
83 * (SQL type: int unsigned)
84 * Note that values will be retrieved from the database as a string.
86 public $frequency_interval;
89 * Total number of payments to be made. Set this to 0 if this is an open-ended commitment i.e. no set end date.
91 * @var int|string|null
92 * (SQL type: int unsigned)
93 * Note that values will be retrieved from the database as a string.
98 * The date the first scheduled recurring contribution occurs.
101 * (SQL type: datetime)
102 * Note that values will be retrieved from the database as a string.
107 * When this recurring contribution record was created.
110 * (SQL type: datetime)
111 * Note that values will be retrieved from the database as a string.
116 * Last updated date for this record. mostly the last time a payment was received
119 * (SQL type: timestamp)
120 * Note that values will be retrieved from the database as a string.
122 public $modified_date;
125 * Date this recurring contribution was cancelled by contributor- if we can get access to it
128 * (SQL type: datetime)
129 * Note that values will be retrieved from the database as a string.
134 * Free text field for a reason for cancelling
138 * Note that values will be retrieved from the database as a string.
140 public $cancel_reason;
143 * Date this recurring contribution finished successfully
146 * (SQL type: datetime)
147 * Note that values will be retrieved from the database as a string.
152 * Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor??
155 * (SQL type: varchar(255))
156 * Note that values will be retrieved from the database as a string.
158 public $processor_id;
161 * Optionally used to store a link to a payment token used for this recurring contribution.
163 * @var int|string|null
164 * (SQL type: int unsigned)
165 * Note that values will be retrieved from the database as a string.
167 public $payment_token_id;
170 * unique transaction id (deprecated - use processor_id)
173 * (SQL type: varchar(255))
174 * Note that values will be retrieved from the database as a string.
179 * unique invoice id, system generated or passed in
182 * (SQL type: varchar(255))
183 * Note that values will be retrieved from the database as a string.
188 * @var int|string|null
189 * (SQL type: int unsigned)
190 * Note that values will be retrieved from the database as a string.
192 public $contribution_status_id;
196 * (SQL type: tinyint)
197 * Note that values will be retrieved from the database as a string.
202 * Day in the period when the payment should be charged e.g. 1st of month, 15th etc.
205 * (SQL type: int unsigned)
206 * Note that values will be retrieved from the database as a string.
211 * Next scheduled date
214 * (SQL type: datetime)
215 * Note that values will be retrieved from the database as a string.
217 public $next_sched_contribution_date;
220 * Number of failed charge attempts since last success. Business rule could be set to deactivate on more than x failures.
222 * @var int|string|null
223 * (SQL type: int unsigned)
224 * Note that values will be retrieved from the database as a string.
226 public $failure_count;
229 * Date to retry failed attempt
232 * (SQL type: datetime)
233 * Note that values will be retrieved from the database as a string.
235 public $failure_retry_date;
238 * Some systems allow contributor to set a number of installments - but then auto-renew the subscription or commitment if they do not cancel.
241 * (SQL type: tinyint)
242 * Note that values will be retrieved from the database as a string.
247 * Foreign key to civicrm_payment_processor.id
249 * @var int|string|null
250 * (SQL type: int unsigned)
251 * Note that values will be retrieved from the database as a string.
253 public $payment_processor_id;
256 * FK to Financial Type
258 * @var int|string|null
259 * (SQL type: int unsigned)
260 * Note that values will be retrieved from the database as a string.
262 public $financial_type_id;
265 * FK to Payment Instrument
267 * @var int|string|null
268 * (SQL type: int unsigned)
269 * Note that values will be retrieved from the database as a string.
271 public $payment_instrument_id;
274 * The campaign for which this contribution has been triggered.
276 * @var int|string|null
277 * (SQL type: int unsigned)
278 * Note that values will be retrieved from the database as a string.
283 * if true, receipt is automatically emailed to contact on each successful payment
286 * (SQL type: tinyint)
287 * Note that values will be retrieved from the database as a string.
289 public $is_email_receipt;
294 public function __construct() {
295 $this->__table
= 'civicrm_contribution_recur';
296 parent
::__construct();
300 * Returns localized title of this entity.
302 * @param bool $plural
303 * Whether to return the plural version of the title.
305 public static function getEntityTitle($plural = FALSE) {
306 return $plural ?
ts('Recurring Contributions') : ts('Recurring Contribution');
310 * Returns foreign keys and entity references.
313 * [CRM_Core_Reference_Interface]
315 public static function getReferenceColumns() {
316 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
317 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
318 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
319 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'payment_token_id', 'civicrm_payment_token', 'id');
320 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'payment_processor_id', 'civicrm_payment_processor', 'id');
321 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'financial_type_id', 'civicrm_financial_type', 'id');
322 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'campaign_id', 'civicrm_campaign', 'id');
323 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
325 return Civi
::$statics[__CLASS__
]['links'];
329 * Returns all the column names of this table
333 public static function &fields() {
334 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
335 Civi
::$statics[__CLASS__
]['fields'] = [
336 'contribution_recur_id' => [
338 'type' => CRM_Utils_Type
::T_INT
,
339 'title' => ts('Recurring Contribution ID'),
340 'description' => ts('Contribution Recur ID'),
342 'where' => 'civicrm_contribution_recur.id',
343 'table_name' => 'civicrm_contribution_recur',
344 'entity' => 'ContributionRecur',
345 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
354 'name' => 'contact_id',
355 'type' => CRM_Utils_Type
::T_INT
,
356 'title' => ts('Contact ID'),
357 'description' => ts('Foreign key to civicrm_contact.id.'),
359 'where' => 'civicrm_contribution_recur.contact_id',
360 'table_name' => 'civicrm_contribution_recur',
361 'entity' => 'ContributionRecur',
362 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
364 'FKClassName' => 'CRM_Contact_DAO_Contact',
366 'type' => 'EntityRef',
367 'label' => ts("Contact"),
373 'type' => CRM_Utils_Type
::T_MONEY
,
374 'title' => ts('Amount'),
375 'description' => ts('Amount to be collected (including any sales tax) by payment processor each recurrence.'),
381 'where' => 'civicrm_contribution_recur.amount',
382 'table_name' => 'civicrm_contribution_recur',
383 'entity' => 'ContributionRecur',
384 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
392 'name' => 'currency',
393 'type' => CRM_Utils_Type
::T_STRING
,
394 'title' => ts('Currency'),
395 'description' => ts('3 character string, value from config setting or input via user.'),
397 'size' => CRM_Utils_Type
::FOUR
,
398 'where' => 'civicrm_contribution_recur.currency',
400 'table_name' => 'civicrm_contribution_recur',
401 'entity' => 'ContributionRecur',
402 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
407 'pseudoconstant' => [
408 'table' => 'civicrm_currency',
409 'keyColumn' => 'name',
410 'labelColumn' => 'full_name',
411 'nameColumn' => 'name',
412 'abbrColumn' => 'symbol',
416 'frequency_unit' => [
417 'name' => 'frequency_unit',
418 'type' => CRM_Utils_Type
::T_STRING
,
419 'title' => ts('Frequency Unit'),
420 'description' => ts('Time units for recurrence of payment.'),
422 'size' => CRM_Utils_Type
::EIGHT
,
423 'where' => 'civicrm_contribution_recur.frequency_unit',
424 'default' => 'month',
425 'table_name' => 'civicrm_contribution_recur',
426 'entity' => 'ContributionRecur',
427 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
432 'pseudoconstant' => [
433 'optionGroupName' => 'recur_frequency_units',
434 'keyColumn' => 'name',
435 'optionEditPath' => 'civicrm/admin/options/recur_frequency_units',
439 'frequency_interval' => [
440 'name' => 'frequency_interval',
441 'type' => CRM_Utils_Type
::T_INT
,
442 'title' => ts('Interval (number of units)'),
443 'description' => ts('Number of time units for recurrence of payment.'),
445 'where' => 'civicrm_contribution_recur.frequency_interval',
447 'table_name' => 'civicrm_contribution_recur',
448 'entity' => 'ContributionRecur',
449 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
457 'name' => 'installments',
458 'type' => CRM_Utils_Type
::T_INT
,
459 'title' => ts('Number of Installments'),
460 'description' => ts('Total number of payments to be made. Set this to 0 if this is an open-ended commitment i.e. no set end date.'),
461 'where' => 'civicrm_contribution_recur.installments',
462 'table_name' => 'civicrm_contribution_recur',
463 'entity' => 'ContributionRecur',
464 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
471 'contribution_recur_start_date' => [
472 'name' => 'start_date',
473 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
474 'title' => ts('Start Date'),
475 'description' => ts('The date the first scheduled recurring contribution occurs.'),
477 'where' => 'civicrm_contribution_recur.start_date',
478 'default' => 'CURRENT_TIMESTAMP',
479 'table_name' => 'civicrm_contribution_recur',
480 'entity' => 'ContributionRecur',
481 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
483 'unique_title' => ts('Recurring Contribution Start Date'),
485 'type' => 'Select Date',
486 'formatType' => 'activityDateTime',
490 'contribution_recur_create_date' => [
491 'name' => 'create_date',
492 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
493 'title' => ts('Created Date'),
494 'description' => ts('When this recurring contribution record was created.'),
496 'where' => 'civicrm_contribution_recur.create_date',
497 'default' => 'CURRENT_TIMESTAMP',
498 'table_name' => 'civicrm_contribution_recur',
499 'entity' => 'ContributionRecur',
500 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
502 'unique_title' => ts('Recurring Contribution Create Date'),
504 'type' => 'Select Date',
505 'formatType' => 'activityDateTime',
509 'contribution_recur_modified_date' => [
510 'name' => 'modified_date',
511 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
512 'title' => ts('Modified Date'),
513 'description' => ts('Last updated date for this record. mostly the last time a payment was received'),
514 'where' => 'civicrm_contribution_recur.modified_date',
515 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
516 'table_name' => 'civicrm_contribution_recur',
517 'entity' => 'ContributionRecur',
518 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
520 'unique_title' => ts('Recurring Contribution Modified Date'),
522 'type' => 'Select Date',
523 'formatType' => 'activityDateTime',
528 'contribution_recur_cancel_date' => [
529 'name' => 'cancel_date',
530 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
531 'title' => ts('Cancel Date'),
532 'description' => ts('Date this recurring contribution was cancelled by contributor- if we can get access to it'),
533 'where' => 'civicrm_contribution_recur.cancel_date',
534 'table_name' => 'civicrm_contribution_recur',
535 'entity' => 'ContributionRecur',
536 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
538 'unique_title' => ts('Recurring Contribution Cancel Date'),
540 'type' => 'Select Date',
541 'formatType' => 'activityDate',
545 'contribution_recur_cancel_reason' => [
546 'name' => 'cancel_reason',
547 'type' => CRM_Utils_Type
::T_TEXT
,
548 'title' => ts('Cancellation Reason'),
549 'description' => ts('Free text field for a reason for cancelling'),
550 'where' => 'civicrm_contribution_recur.cancel_reason',
551 'table_name' => 'civicrm_contribution_recur',
552 'entity' => 'ContributionRecur',
553 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
555 'unique_title' => ts('Recurring Contribution Cancel Reason'),
561 'contribution_recur_end_date' => [
562 'name' => 'end_date',
563 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
564 'title' => ts('Recurring Contribution End Date'),
565 'description' => ts('Date this recurring contribution finished successfully'),
566 'where' => 'civicrm_contribution_recur.end_date',
567 'table_name' => 'civicrm_contribution_recur',
568 'entity' => 'ContributionRecur',
569 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
571 'unique_title' => ts('Recurring Contribution End Date'),
573 'type' => 'Select Date',
574 'formatType' => 'activityDate',
578 'contribution_recur_processor_id' => [
579 'name' => 'processor_id',
580 'type' => CRM_Utils_Type
::T_STRING
,
581 'title' => ts('Processor ID'),
582 'description' => ts('Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor??'),
584 'size' => CRM_Utils_Type
::HUGE
,
585 'where' => 'civicrm_contribution_recur.processor_id',
586 'table_name' => 'civicrm_contribution_recur',
587 'entity' => 'ContributionRecur',
588 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
595 'payment_token_id' => [
596 'name' => 'payment_token_id',
597 'type' => CRM_Utils_Type
::T_INT
,
598 'title' => ts('Payment Token ID'),
599 'description' => ts('Optionally used to store a link to a payment token used for this recurring contribution.'),
600 'where' => 'civicrm_contribution_recur.payment_token_id',
601 'table_name' => 'civicrm_contribution_recur',
602 'entity' => 'ContributionRecur',
603 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
605 'FKClassName' => 'CRM_Financial_DAO_PaymentToken',
607 'label' => ts("Payment Token"),
611 'contribution_recur_trxn_id' => [
613 'type' => CRM_Utils_Type
::T_STRING
,
614 'title' => ts('Transaction ID'),
615 'description' => ts('unique transaction id (deprecated - use processor_id)'),
617 'size' => CRM_Utils_Type
::HUGE
,
618 'where' => 'civicrm_contribution_recur.trxn_id',
619 'table_name' => 'civicrm_contribution_recur',
620 'entity' => 'ContributionRecur',
621 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
629 'name' => 'invoice_id',
630 'type' => CRM_Utils_Type
::T_STRING
,
631 'title' => ts('Invoice ID'),
632 'description' => ts('unique invoice id, system generated or passed in'),
634 'size' => CRM_Utils_Type
::HUGE
,
635 'where' => 'civicrm_contribution_recur.invoice_id',
636 'table_name' => 'civicrm_contribution_recur',
637 'entity' => 'ContributionRecur',
638 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
645 'contribution_recur_contribution_status_id' => [
646 'name' => 'contribution_status_id',
647 'type' => CRM_Utils_Type
::T_INT
,
648 'title' => ts('Status'),
650 'where' => 'civicrm_contribution_recur.contribution_status_id',
653 'table_name' => 'civicrm_contribution_recur',
654 'entity' => 'ContributionRecur',
655 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
660 'pseudoconstant' => [
661 'optionGroupName' => 'contribution_recur_status',
662 'optionEditPath' => 'civicrm/admin/options/contribution_recur_status',
668 'type' => CRM_Utils_Type
::T_BOOLEAN
,
669 'title' => ts('Test'),
672 'where' => 'civicrm_contribution_recur.is_test',
675 'table_name' => 'civicrm_contribution_recur',
676 'entity' => 'ContributionRecur',
677 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
680 'type' => 'CheckBox',
685 'name' => 'cycle_day',
686 'type' => CRM_Utils_Type
::T_INT
,
687 'title' => ts('Cycle Day'),
688 'description' => ts('Day in the period when the payment should be charged e.g. 1st of month, 15th etc.'),
690 'where' => 'civicrm_contribution_recur.cycle_day',
692 'table_name' => 'civicrm_contribution_recur',
693 'entity' => 'ContributionRecur',
694 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
701 'contribution_recur_next_sched_contribution_date' => [
702 'name' => 'next_sched_contribution_date',
703 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
704 'title' => ts('Next Scheduled Contribution Date'),
705 'description' => ts('Next scheduled date'),
706 'where' => 'civicrm_contribution_recur.next_sched_contribution_date',
707 'table_name' => 'civicrm_contribution_recur',
708 'entity' => 'ContributionRecur',
709 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
711 'unique_title' => ts('Next Scheduled Recurring Contribution'),
713 'type' => 'Select Date',
714 'formatType' => 'activityDate',
719 'name' => 'failure_count',
720 'type' => CRM_Utils_Type
::T_INT
,
721 'title' => ts('Number of Failures'),
722 'description' => ts('Number of failed charge attempts since last success. Business rule could be set to deactivate on more than x failures.'),
723 'where' => 'civicrm_contribution_recur.failure_count',
725 'table_name' => 'civicrm_contribution_recur',
726 'entity' => 'ContributionRecur',
727 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
734 'contribution_recur_failure_retry_date' => [
735 'name' => 'failure_retry_date',
736 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
737 'title' => ts('Retry Failed Attempt Date'),
738 'description' => ts('Date to retry failed attempt'),
739 'where' => 'civicrm_contribution_recur.failure_retry_date',
740 'table_name' => 'civicrm_contribution_recur',
741 'entity' => 'ContributionRecur',
742 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
744 'unique_title' => ts('Failed Recurring Contribution Retry Date'),
746 'type' => 'Select Date',
747 'formatType' => 'activityDate',
752 'name' => 'auto_renew',
753 'type' => CRM_Utils_Type
::T_BOOLEAN
,
754 'title' => ts('Auto Renew'),
755 'description' => ts('Some systems allow contributor to set a number of installments - but then auto-renew the subscription or commitment if they do not cancel.'),
757 'where' => 'civicrm_contribution_recur.auto_renew',
759 'table_name' => 'civicrm_contribution_recur',
760 'entity' => 'ContributionRecur',
761 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
764 'type' => 'CheckBox',
768 'contribution_recur_payment_processor_id' => [
769 'name' => 'payment_processor_id',
770 'type' => CRM_Utils_Type
::T_INT
,
771 'title' => ts('Payment Processor ID'),
772 'description' => ts('Foreign key to civicrm_payment_processor.id'),
773 'where' => 'civicrm_contribution_recur.payment_processor_id',
774 'table_name' => 'civicrm_contribution_recur',
775 'entity' => 'ContributionRecur',
776 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
778 'FKClassName' => 'CRM_Financial_DAO_PaymentProcessor',
781 'label' => ts("Payment Processor"),
783 'pseudoconstant' => [
784 'table' => 'civicrm_payment_processor',
786 'labelColumn' => 'title',
790 'financial_type_id' => [
791 'name' => 'financial_type_id',
792 'type' => CRM_Utils_Type
::T_INT
,
793 'title' => ts('Financial Type ID'),
794 'description' => ts('FK to Financial Type'),
795 'where' => 'civicrm_contribution_recur.financial_type_id',
797 'table_name' => 'civicrm_contribution_recur',
798 'entity' => 'ContributionRecur',
799 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
801 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
804 'label' => ts("Financial Type"),
806 'pseudoconstant' => [
807 'table' => 'civicrm_financial_type',
809 'labelColumn' => 'name',
813 'payment_instrument_id' => [
814 'name' => 'payment_instrument_id',
815 'type' => CRM_Utils_Type
::T_INT
,
816 'title' => ts('Payment Method'),
817 'description' => ts('FK to Payment Instrument'),
818 'where' => 'civicrm_contribution_recur.payment_instrument_id',
819 'table_name' => 'civicrm_contribution_recur',
820 'entity' => 'ContributionRecur',
821 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
826 'pseudoconstant' => [
827 'optionGroupName' => 'payment_instrument',
828 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
832 'contribution_campaign_id' => [
833 'name' => 'campaign_id',
834 'type' => CRM_Utils_Type
::T_INT
,
835 'title' => ts('Campaign ID'),
836 'description' => ts('The campaign for which this contribution has been triggered.'),
838 'where' => 'civicrm_contribution_recur.campaign_id',
840 'table_name' => 'civicrm_contribution_recur',
841 'entity' => 'ContributionRecur',
842 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
844 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
845 'component' => 'CiviCampaign',
847 'type' => 'EntityRef',
848 'label' => ts("Campaign"),
850 'pseudoconstant' => [
851 'table' => 'civicrm_campaign',
853 'labelColumn' => 'title',
854 'prefetch' => 'FALSE',
858 'is_email_receipt' => [
859 'name' => 'is_email_receipt',
860 'type' => CRM_Utils_Type
::T_BOOLEAN
,
861 'title' => ts('Send email Receipt?'),
862 'description' => ts('if true, receipt is automatically emailed to contact on each successful payment'),
864 'where' => 'civicrm_contribution_recur.is_email_receipt',
866 'table_name' => 'civicrm_contribution_recur',
867 'entity' => 'ContributionRecur',
868 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
871 'type' => 'CheckBox',
876 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
878 return Civi
::$statics[__CLASS__
]['fields'];
882 * Return a mapping from field-name to the corresponding key (as used in fields()).
885 * Array(string $name => string $uniqueName).
887 public static function &fieldKeys() {
888 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
889 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
891 return Civi
::$statics[__CLASS__
]['fieldKeys'];
895 * Returns the names of this table
899 public static function getTableName() {
900 return self
::$_tableName;
904 * Returns if this table needs to be logged
908 public function getLog() {
913 * Returns the list of fields that can be imported
915 * @param bool $prefix
919 public static function &import($prefix = FALSE) {
920 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_recur', $prefix, []);
925 * Returns the list of fields that can be exported
927 * @param bool $prefix
931 public static function &export($prefix = FALSE) {
932 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_recur', $prefix, []);
937 * Returns the list of indices
939 * @param bool $localize
943 public static function indices($localize = TRUE) {
945 'UI_contrib_trxn_id' => [
946 'name' => 'UI_contrib_trxn_id',
950 'localizable' => FALSE,
952 'sig' => 'civicrm_contribution_recur::1::trxn_id',
954 'UI_contrib_invoice_id' => [
955 'name' => 'UI_contrib_invoice_id',
959 'localizable' => FALSE,
961 'sig' => 'civicrm_contribution_recur::1::invoice_id',
963 'index_contribution_status' => [
964 'name' => 'index_contribution_status',
966 0 => 'contribution_status_id',
968 'localizable' => FALSE,
969 'sig' => 'civicrm_contribution_recur::0::contribution_status_id',
971 'UI_contribution_recur_payment_instrument_id' => [
972 'name' => 'UI_contribution_recur_payment_instrument_id',
974 0 => 'payment_instrument_id',
976 'localizable' => FALSE,
977 'sig' => 'civicrm_contribution_recur::0::payment_instrument_id',
980 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;