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:fd697cd9f74b697ebc373d3a62526be0)
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. may be processor id, bank id + trans id, or account number + check number... depending on payment_method
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;
195 * @var bool|string|null
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
285 * @var bool|string|null
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. may be processor id, bank id + trans id, or account number + check number... depending on payment_method'),
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'),
671 'where' => 'civicrm_contribution_recur.is_test',
674 'table_name' => 'civicrm_contribution_recur',
675 'entity' => 'ContributionRecur',
676 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
679 'type' => 'CheckBox',
684 'name' => 'cycle_day',
685 'type' => CRM_Utils_Type
::T_INT
,
686 'title' => ts('Cycle Day'),
687 'description' => ts('Day in the period when the payment should be charged e.g. 1st of month, 15th etc.'),
689 'where' => 'civicrm_contribution_recur.cycle_day',
691 'table_name' => 'civicrm_contribution_recur',
692 'entity' => 'ContributionRecur',
693 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
700 'contribution_recur_next_sched_contribution_date' => [
701 'name' => 'next_sched_contribution_date',
702 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
703 'title' => ts('Next Scheduled Contribution Date'),
704 'description' => ts('Next scheduled date'),
705 'where' => 'civicrm_contribution_recur.next_sched_contribution_date',
706 'table_name' => 'civicrm_contribution_recur',
707 'entity' => 'ContributionRecur',
708 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
710 'unique_title' => ts('Next Scheduled Recurring Contribution'),
712 'type' => 'Select Date',
713 'formatType' => 'activityDate',
718 'name' => 'failure_count',
719 'type' => CRM_Utils_Type
::T_INT
,
720 'title' => ts('Number of Failures'),
721 'description' => ts('Number of failed charge attempts since last success. Business rule could be set to deactivate on more than x failures.'),
722 'where' => 'civicrm_contribution_recur.failure_count',
724 'table_name' => 'civicrm_contribution_recur',
725 'entity' => 'ContributionRecur',
726 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
733 'contribution_recur_failure_retry_date' => [
734 'name' => 'failure_retry_date',
735 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
736 'title' => ts('Retry Failed Attempt Date'),
737 'description' => ts('Date to retry failed attempt'),
738 'where' => 'civicrm_contribution_recur.failure_retry_date',
739 'table_name' => 'civicrm_contribution_recur',
740 'entity' => 'ContributionRecur',
741 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
743 'unique_title' => ts('Failed Recurring Contribution Retry Date'),
745 'type' => 'Select Date',
746 'formatType' => 'activityDate',
751 'name' => 'auto_renew',
752 'type' => CRM_Utils_Type
::T_BOOLEAN
,
753 'title' => ts('Auto Renew'),
754 '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.'),
756 'where' => 'civicrm_contribution_recur.auto_renew',
758 'table_name' => 'civicrm_contribution_recur',
759 'entity' => 'ContributionRecur',
760 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
763 'type' => 'CheckBox',
767 'contribution_recur_payment_processor_id' => [
768 'name' => 'payment_processor_id',
769 'type' => CRM_Utils_Type
::T_INT
,
770 'title' => ts('Payment Processor ID'),
771 'description' => ts('Foreign key to civicrm_payment_processor.id'),
772 'where' => 'civicrm_contribution_recur.payment_processor_id',
773 'table_name' => 'civicrm_contribution_recur',
774 'entity' => 'ContributionRecur',
775 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
777 'FKClassName' => 'CRM_Financial_DAO_PaymentProcessor',
780 'label' => ts("Payment Processor"),
782 'pseudoconstant' => [
783 'table' => 'civicrm_payment_processor',
785 'labelColumn' => 'name',
789 'financial_type_id' => [
790 'name' => 'financial_type_id',
791 'type' => CRM_Utils_Type
::T_INT
,
792 'title' => ts('Financial Type ID'),
793 'description' => ts('FK to Financial Type'),
794 'where' => 'civicrm_contribution_recur.financial_type_id',
796 'table_name' => 'civicrm_contribution_recur',
797 'entity' => 'ContributionRecur',
798 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
800 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
803 'label' => ts("Financial Type"),
805 'pseudoconstant' => [
806 'table' => 'civicrm_financial_type',
808 'labelColumn' => 'name',
812 'payment_instrument_id' => [
813 'name' => 'payment_instrument_id',
814 'type' => CRM_Utils_Type
::T_INT
,
815 'title' => ts('Payment Method'),
816 'description' => ts('FK to Payment Instrument'),
817 'where' => 'civicrm_contribution_recur.payment_instrument_id',
818 'table_name' => 'civicrm_contribution_recur',
819 'entity' => 'ContributionRecur',
820 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
825 'pseudoconstant' => [
826 'optionGroupName' => 'payment_instrument',
827 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
831 'contribution_campaign_id' => [
832 'name' => 'campaign_id',
833 'type' => CRM_Utils_Type
::T_INT
,
834 'title' => ts('Campaign ID'),
835 'description' => ts('The campaign for which this contribution has been triggered.'),
837 'where' => 'civicrm_contribution_recur.campaign_id',
839 'table_name' => 'civicrm_contribution_recur',
840 'entity' => 'ContributionRecur',
841 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
843 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
844 'component' => 'CiviCampaign',
846 'type' => 'EntityRef',
847 'label' => ts("Campaign"),
849 'pseudoconstant' => [
850 'table' => 'civicrm_campaign',
852 'labelColumn' => 'title',
853 'prefetch' => 'FALSE',
857 'is_email_receipt' => [
858 'name' => 'is_email_receipt',
859 'type' => CRM_Utils_Type
::T_BOOLEAN
,
860 'title' => ts('Send email Receipt?'),
861 'description' => ts('if true, receipt is automatically emailed to contact on each successful payment'),
862 'where' => 'civicrm_contribution_recur.is_email_receipt',
864 'table_name' => 'civicrm_contribution_recur',
865 'entity' => 'ContributionRecur',
866 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
869 'type' => 'CheckBox',
874 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
876 return Civi
::$statics[__CLASS__
]['fields'];
880 * Return a mapping from field-name to the corresponding key (as used in fields()).
883 * Array(string $name => string $uniqueName).
885 public static function &fieldKeys() {
886 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
887 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
889 return Civi
::$statics[__CLASS__
]['fieldKeys'];
893 * Returns the names of this table
897 public static function getTableName() {
898 return self
::$_tableName;
902 * Returns if this table needs to be logged
906 public function getLog() {
911 * Returns the list of fields that can be imported
913 * @param bool $prefix
917 public static function &import($prefix = FALSE) {
918 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_recur', $prefix, []);
923 * Returns the list of fields that can be exported
925 * @param bool $prefix
929 public static function &export($prefix = FALSE) {
930 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_recur', $prefix, []);
935 * Returns the list of indices
937 * @param bool $localize
941 public static function indices($localize = TRUE) {
943 'UI_contrib_trxn_id' => [
944 'name' => 'UI_contrib_trxn_id',
948 'localizable' => FALSE,
950 'sig' => 'civicrm_contribution_recur::1::trxn_id',
952 'UI_contrib_invoice_id' => [
953 'name' => 'UI_contrib_invoice_id',
957 'localizable' => FALSE,
959 'sig' => 'civicrm_contribution_recur::1::invoice_id',
961 'index_contribution_status' => [
962 'name' => 'index_contribution_status',
964 0 => 'contribution_status_id',
966 'localizable' => FALSE,
967 'sig' => 'civicrm_contribution_recur::0::contribution_status_id',
969 'UI_contribution_recur_payment_instrument_id' => [
970 'name' => 'UI_contribution_recur_payment_instrument_id',
972 0 => 'payment_instrument_id',
974 'localizable' => FALSE,
975 'sig' => 'civicrm_contribution_recur::0::payment_instrument_id',
978 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;