Merge pull request #12667 from mlutfy/translation-14
[civicrm-core.git] / CRM / Contribute / DAO / ContributionRecur.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2018
6 *
7 * Generated from xml/schema/CRM/Contribute/ContributionRecur.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:a1007a4585bac4fcb04ce47535aecec0)
10 */
11
12 /**
13 * Database access object for the ContributionRecur entity.
14 */
15 class CRM_Contribute_DAO_ContributionRecur extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_contribution_recur';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 static $_log = TRUE;
30
31 /**
32 * Contribution Recur ID
33 *
34 * @var int unsigned
35 */
36 public $id;
37
38 /**
39 * Foreign key to civicrm_contact.id .
40 *
41 * @var int unsigned
42 */
43 public $contact_id;
44
45 /**
46 * Amount to be contributed or charged each recurrence.
47 *
48 * @var float
49 */
50 public $amount;
51
52 /**
53 * 3 character string, value from config setting or input via user.
54 *
55 * @var string
56 */
57 public $currency;
58
59 /**
60 * Time units for recurrence of payment.
61 *
62 * @var string
63 */
64 public $frequency_unit;
65
66 /**
67 * Number of time units for recurrence of payment.
68 *
69 * @var int unsigned
70 */
71 public $frequency_interval;
72
73 /**
74 * Total number of payments to be made. Set this to 0 if this is an open-ended commitment i.e. no set end date.
75 *
76 * @var int unsigned
77 */
78 public $installments;
79
80 /**
81 * The date the first scheduled recurring contribution occurs.
82 *
83 * @var datetime
84 */
85 public $start_date;
86
87 /**
88 * When this recurring contribution record was created.
89 *
90 * @var datetime
91 */
92 public $create_date;
93
94 /**
95 * Last updated date for this record. mostly the last time a payment was received
96 *
97 * @var datetime
98 */
99 public $modified_date;
100
101 /**
102 * Date this recurring contribution was cancelled by contributor- if we can get access to it
103 *
104 * @var datetime
105 */
106 public $cancel_date;
107
108 /**
109 * Date this recurring contribution finished successfully
110 *
111 * @var datetime
112 */
113 public $end_date;
114
115 /**
116 * Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor??
117 *
118 * @var string
119 */
120 public $processor_id;
121
122 /**
123 * Optionally used to store a link to a payment token used for this recurring contribution.
124 *
125 * @var int unsigned
126 */
127 public $payment_token_id;
128
129 /**
130 * unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method
131 *
132 * @var string
133 */
134 public $trxn_id;
135
136 /**
137 * unique invoice id, system generated or passed in
138 *
139 * @var string
140 */
141 public $invoice_id;
142
143 /**
144 * @var int unsigned
145 */
146 public $contribution_status_id;
147
148 /**
149 * @var boolean
150 */
151 public $is_test;
152
153 /**
154 * Day in the period when the payment should be charged e.g. 1st of month, 15th etc.
155 *
156 * @var int unsigned
157 */
158 public $cycle_day;
159
160 /**
161 * Next scheduled date
162 *
163 * @var datetime
164 */
165 public $next_sched_contribution_date;
166
167 /**
168 * Number of failed charge attempts since last success. Business rule could be set to deactivate on more than x failures.
169 *
170 * @var int unsigned
171 */
172 public $failure_count;
173
174 /**
175 * Date to retry failed attempt
176 *
177 * @var datetime
178 */
179 public $failure_retry_date;
180
181 /**
182 * Some systems allow contributor to set a number of installments - but then auto-renew the subscription or commitment if they do not cancel.
183 *
184 * @var boolean
185 */
186 public $auto_renew;
187
188 /**
189 * Foreign key to civicrm_payment_processor.id
190 *
191 * @var int unsigned
192 */
193 public $payment_processor_id;
194
195 /**
196 * FK to Financial Type
197 *
198 * @var int unsigned
199 */
200 public $financial_type_id;
201
202 /**
203 * FK to Payment Instrument
204 *
205 * @var int unsigned
206 */
207 public $payment_instrument_id;
208
209 /**
210 * The campaign for which this contribution has been triggered.
211 *
212 * @var int unsigned
213 */
214 public $campaign_id;
215
216 /**
217 * if true, receipt is automatically emailed to contact on each successful payment
218 *
219 * @var boolean
220 */
221 public $is_email_receipt;
222
223 /**
224 * Class constructor.
225 */
226 public function __construct() {
227 $this->__table = 'civicrm_contribution_recur';
228 parent::__construct();
229 }
230
231 /**
232 * Returns foreign keys and entity references.
233 *
234 * @return array
235 * [CRM_Core_Reference_Interface]
236 */
237 public static function getReferenceColumns() {
238 if (!isset(Civi::$statics[__CLASS__]['links'])) {
239 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
240 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id');
241 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'payment_token_id', 'civicrm_payment_token', 'id');
242 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'payment_processor_id', 'civicrm_payment_processor', 'id');
243 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'financial_type_id', 'civicrm_financial_type', 'id');
244 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'campaign_id', 'civicrm_campaign', 'id');
245 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
246 }
247 return Civi::$statics[__CLASS__]['links'];
248 }
249
250 /**
251 * Returns all the column names of this table
252 *
253 * @return array
254 */
255 public static function &fields() {
256 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
257 Civi::$statics[__CLASS__]['fields'] = [
258 'id' => [
259 'name' => 'id',
260 'type' => CRM_Utils_Type::T_INT,
261 'title' => ts('Recurring Contribution ID'),
262 'description' => 'Contribution Recur ID',
263 'required' => TRUE,
264 'table_name' => 'civicrm_contribution_recur',
265 'entity' => 'ContributionRecur',
266 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
267 'localizable' => 0,
268 ],
269 'contact_id' => [
270 'name' => 'contact_id',
271 'type' => CRM_Utils_Type::T_INT,
272 'title' => ts('Contact ID'),
273 'description' => 'Foreign key to civicrm_contact.id .',
274 'required' => TRUE,
275 'table_name' => 'civicrm_contribution_recur',
276 'entity' => 'ContributionRecur',
277 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
278 'localizable' => 0,
279 'FKClassName' => 'CRM_Contact_DAO_Contact',
280 ],
281 'amount' => [
282 'name' => 'amount',
283 'type' => CRM_Utils_Type::T_MONEY,
284 'title' => ts('Amount'),
285 'description' => 'Amount to be contributed or charged each recurrence.',
286 'required' => TRUE,
287 'precision' => [
288 20,
289 2
290 ],
291 'table_name' => 'civicrm_contribution_recur',
292 'entity' => 'ContributionRecur',
293 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
294 'localizable' => 0,
295 'html' => [
296 'type' => 'Text',
297 ],
298 ],
299 'currency' => [
300 'name' => 'currency',
301 'type' => CRM_Utils_Type::T_STRING,
302 'title' => ts('Currency'),
303 'description' => '3 character string, value from config setting or input via user.',
304 'maxlength' => 3,
305 'size' => CRM_Utils_Type::FOUR,
306 'default' => 'NULL',
307 'table_name' => 'civicrm_contribution_recur',
308 'entity' => 'ContributionRecur',
309 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
310 'localizable' => 0,
311 'html' => [
312 'type' => 'Select',
313 ],
314 'pseudoconstant' => [
315 'table' => 'civicrm_currency',
316 'keyColumn' => 'name',
317 'labelColumn' => 'full_name',
318 'nameColumn' => 'name',
319 ]
320 ],
321 'frequency_unit' => [
322 'name' => 'frequency_unit',
323 'type' => CRM_Utils_Type::T_STRING,
324 'title' => ts('Frequency Unit'),
325 'description' => 'Time units for recurrence of payment.',
326 'maxlength' => 8,
327 'size' => CRM_Utils_Type::EIGHT,
328 'default' => 'month',
329 'table_name' => 'civicrm_contribution_recur',
330 'entity' => 'ContributionRecur',
331 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
332 'localizable' => 0,
333 'html' => [
334 'type' => 'Select',
335 ],
336 'pseudoconstant' => [
337 'optionGroupName' => 'recur_frequency_units',
338 'keyColumn' => 'name',
339 'optionEditPath' => 'civicrm/admin/options/recur_frequency_units',
340 ]
341 ],
342 'frequency_interval' => [
343 'name' => 'frequency_interval',
344 'type' => CRM_Utils_Type::T_INT,
345 'title' => ts('Interval (number of units)'),
346 'description' => 'Number of time units for recurrence of payment.',
347 'required' => TRUE,
348 'table_name' => 'civicrm_contribution_recur',
349 'entity' => 'ContributionRecur',
350 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
351 'localizable' => 0,
352 'html' => [
353 'type' => 'Text',
354 ],
355 ],
356 'installments' => [
357 'name' => 'installments',
358 'type' => CRM_Utils_Type::T_INT,
359 'title' => ts('Number of Installments'),
360 'description' => 'Total number of payments to be made. Set this to 0 if this is an open-ended commitment i.e. no set end date.',
361 'table_name' => 'civicrm_contribution_recur',
362 'entity' => 'ContributionRecur',
363 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
364 'localizable' => 0,
365 'html' => [
366 'type' => 'Text',
367 ],
368 ],
369 'start_date' => [
370 'name' => 'start_date',
371 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
372 'title' => ts('Recurring Contribution Started Date'),
373 'description' => 'The date the first scheduled recurring contribution occurs.',
374 'required' => TRUE,
375 'table_name' => 'civicrm_contribution_recur',
376 'entity' => 'ContributionRecur',
377 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
378 'localizable' => 0,
379 'html' => [
380 'type' => 'Select Date',
381 ],
382 ],
383 'create_date' => [
384 'name' => 'create_date',
385 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
386 'title' => ts('Recurring Contribution Created Date'),
387 'description' => 'When this recurring contribution record was created.',
388 'required' => TRUE,
389 'table_name' => 'civicrm_contribution_recur',
390 'entity' => 'ContributionRecur',
391 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
392 'localizable' => 0,
393 'html' => [
394 'type' => 'Select Date',
395 ],
396 ],
397 'modified_date' => [
398 'name' => 'modified_date',
399 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
400 'title' => ts('Recurring Contribution Modified Date'),
401 'description' => 'Last updated date for this record. mostly the last time a payment was received',
402 'table_name' => 'civicrm_contribution_recur',
403 'entity' => 'ContributionRecur',
404 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
405 'localizable' => 0,
406 'html' => [
407 'type' => 'Select Date',
408 ],
409 ],
410 'cancel_date' => [
411 'name' => 'cancel_date',
412 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
413 'title' => ts('Recurring Contribution Cancel Date'),
414 'description' => 'Date this recurring contribution was cancelled by contributor- if we can get access to it',
415 'table_name' => 'civicrm_contribution_recur',
416 'entity' => 'ContributionRecur',
417 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
418 'localizable' => 0,
419 'html' => [
420 'type' => 'Select Date',
421 ],
422 ],
423 'end_date' => [
424 'name' => 'end_date',
425 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
426 'title' => ts('Recurring Contribution End Date'),
427 'description' => 'Date this recurring contribution finished successfully',
428 'table_name' => 'civicrm_contribution_recur',
429 'entity' => 'ContributionRecur',
430 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
431 'localizable' => 0,
432 'html' => [
433 'type' => 'Select Date',
434 ],
435 ],
436 'processor_id' => [
437 'name' => 'processor_id',
438 'type' => CRM_Utils_Type::T_STRING,
439 'title' => ts('Processor ID'),
440 'description' => 'Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor??',
441 'maxlength' => 255,
442 'size' => CRM_Utils_Type::HUGE,
443 'table_name' => 'civicrm_contribution_recur',
444 'entity' => 'ContributionRecur',
445 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
446 'localizable' => 0,
447 ],
448 'payment_token_id' => [
449 'name' => 'payment_token_id',
450 'type' => CRM_Utils_Type::T_INT,
451 'title' => ts('Payment Token ID'),
452 'description' => 'Optionally used to store a link to a payment token used for this recurring contribution.',
453 'table_name' => 'civicrm_contribution_recur',
454 'entity' => 'ContributionRecur',
455 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
456 'localizable' => 0,
457 'FKClassName' => 'CRM_Financial_DAO_PaymentToken',
458 ],
459 'trxn_id' => [
460 'name' => 'trxn_id',
461 'type' => CRM_Utils_Type::T_STRING,
462 'title' => ts('Transaction ID'),
463 'description' => 'unique transaction id. may be processor id, bank id + trans id, or account number + check number... depending on payment_method',
464 'maxlength' => 255,
465 'size' => CRM_Utils_Type::HUGE,
466 'table_name' => 'civicrm_contribution_recur',
467 'entity' => 'ContributionRecur',
468 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
469 'localizable' => 0,
470 ],
471 'invoice_id' => [
472 'name' => 'invoice_id',
473 'type' => CRM_Utils_Type::T_STRING,
474 'title' => ts('Invoice ID'),
475 'description' => 'unique invoice id, system generated or passed in',
476 'maxlength' => 255,
477 'size' => CRM_Utils_Type::HUGE,
478 'table_name' => 'civicrm_contribution_recur',
479 'entity' => 'ContributionRecur',
480 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
481 'localizable' => 0,
482 ],
483 'contribution_status_id' => [
484 'name' => 'contribution_status_id',
485 'type' => CRM_Utils_Type::T_INT,
486 'title' => ts('Recurring Contribution Status'),
487 'import' => TRUE,
488 'where' => 'civicrm_contribution_recur.contribution_status_id',
489 'headerPattern' => '',
490 'dataPattern' => '',
491 'export' => TRUE,
492 'default' => '1',
493 'table_name' => 'civicrm_contribution_recur',
494 'entity' => 'ContributionRecur',
495 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
496 'localizable' => 0,
497 'pseudoconstant' => [
498 'optionGroupName' => 'contribution_status',
499 'optionEditPath' => 'civicrm/admin/options/contribution_status',
500 ]
501 ],
502 'is_test' => [
503 'name' => 'is_test',
504 'type' => CRM_Utils_Type::T_BOOLEAN,
505 'title' => ts('Test'),
506 'import' => TRUE,
507 'where' => 'civicrm_contribution_recur.is_test',
508 'headerPattern' => '',
509 'dataPattern' => '',
510 'export' => TRUE,
511 'default' => '0',
512 'table_name' => 'civicrm_contribution_recur',
513 'entity' => 'ContributionRecur',
514 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
515 'localizable' => 0,
516 'html' => [
517 'type' => 'CheckBox',
518 ],
519 ],
520 'cycle_day' => [
521 'name' => 'cycle_day',
522 'type' => CRM_Utils_Type::T_INT,
523 'title' => ts('Number of Cycle Day'),
524 'description' => 'Day in the period when the payment should be charged e.g. 1st of month, 15th etc.',
525 'required' => TRUE,
526 'default' => '1',
527 'table_name' => 'civicrm_contribution_recur',
528 'entity' => 'ContributionRecur',
529 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
530 'localizable' => 0,
531 'html' => [
532 'type' => 'Text',
533 ],
534 ],
535 'next_sched_contribution_date' => [
536 'name' => 'next_sched_contribution_date',
537 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
538 'title' => ts('Next Scheduled Contribution Date'),
539 'description' => 'Next scheduled date',
540 'table_name' => 'civicrm_contribution_recur',
541 'entity' => 'ContributionRecur',
542 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
543 'localizable' => 0,
544 'html' => [
545 'type' => 'Select Date',
546 ],
547 ],
548 'failure_count' => [
549 'name' => 'failure_count',
550 'type' => CRM_Utils_Type::T_INT,
551 'title' => ts('Number of Failures'),
552 'description' => 'Number of failed charge attempts since last success. Business rule could be set to deactivate on more than x failures.',
553 'default' => '0',
554 'table_name' => 'civicrm_contribution_recur',
555 'entity' => 'ContributionRecur',
556 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
557 'localizable' => 0,
558 'html' => [
559 'type' => 'Text',
560 ],
561 ],
562 'failure_retry_date' => [
563 'name' => 'failure_retry_date',
564 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
565 'title' => ts('Retry Failed Attempt Date'),
566 'description' => 'Date to retry failed attempt',
567 'table_name' => 'civicrm_contribution_recur',
568 'entity' => 'ContributionRecur',
569 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
570 'localizable' => 0,
571 'html' => [
572 'type' => 'Select Date',
573 ],
574 ],
575 'auto_renew' => [
576 'name' => 'auto_renew',
577 'type' => CRM_Utils_Type::T_BOOLEAN,
578 'title' => ts('Auto Renew'),
579 'description' => 'Some systems allow contributor to set a number of installments - but then auto-renew the subscription or commitment if they do not cancel.',
580 'required' => TRUE,
581 'default' => '0',
582 'table_name' => 'civicrm_contribution_recur',
583 'entity' => 'ContributionRecur',
584 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
585 'localizable' => 0,
586 'html' => [
587 'type' => 'CheckBox',
588 ],
589 ],
590 'payment_processor_id' => [
591 'name' => 'payment_processor_id',
592 'type' => CRM_Utils_Type::T_INT,
593 'title' => ts('Payment Processor'),
594 'description' => 'Foreign key to civicrm_payment_processor.id',
595 'table_name' => 'civicrm_contribution_recur',
596 'entity' => 'ContributionRecur',
597 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
598 'localizable' => 0,
599 'FKClassName' => 'CRM_Financial_DAO_PaymentProcessor',
600 ],
601 'financial_type_id' => [
602 'name' => 'financial_type_id',
603 'type' => CRM_Utils_Type::T_INT,
604 'title' => ts('Financial Type'),
605 'description' => 'FK to Financial Type',
606 'export' => FALSE,
607 'where' => 'civicrm_contribution_recur.financial_type_id',
608 'headerPattern' => '',
609 'dataPattern' => '',
610 'table_name' => 'civicrm_contribution_recur',
611 'entity' => 'ContributionRecur',
612 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
613 'localizable' => 0,
614 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
615 'pseudoconstant' => [
616 'table' => 'civicrm_financial_type',
617 'keyColumn' => 'id',
618 'labelColumn' => 'name',
619 ]
620 ],
621 'payment_instrument_id' => [
622 'name' => 'payment_instrument_id',
623 'type' => CRM_Utils_Type::T_INT,
624 'title' => ts('Payment Method'),
625 'description' => 'FK to Payment Instrument',
626 'table_name' => 'civicrm_contribution_recur',
627 'entity' => 'ContributionRecur',
628 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
629 'localizable' => 0,
630 'html' => [
631 'type' => 'Select',
632 ],
633 'pseudoconstant' => [
634 'optionGroupName' => 'payment_instrument',
635 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
636 ]
637 ],
638 'contribution_campaign_id' => [
639 'name' => 'campaign_id',
640 'type' => CRM_Utils_Type::T_INT,
641 'title' => ts('Campaign'),
642 'description' => 'The campaign for which this contribution has been triggered.',
643 'import' => TRUE,
644 'where' => 'civicrm_contribution_recur.campaign_id',
645 'headerPattern' => '',
646 'dataPattern' => '',
647 'export' => TRUE,
648 'table_name' => 'civicrm_contribution_recur',
649 'entity' => 'ContributionRecur',
650 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
651 'localizable' => 0,
652 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
653 'pseudoconstant' => [
654 'table' => 'civicrm_campaign',
655 'keyColumn' => 'id',
656 'labelColumn' => 'title',
657 ]
658 ],
659 'is_email_receipt' => [
660 'name' => 'is_email_receipt',
661 'type' => CRM_Utils_Type::T_BOOLEAN,
662 'title' => ts('Send email Receipt?'),
663 'description' => 'if true, receipt is automatically emailed to contact on each successful payment',
664 'default' => '1',
665 'table_name' => 'civicrm_contribution_recur',
666 'entity' => 'ContributionRecur',
667 'bao' => 'CRM_Contribute_BAO_ContributionRecur',
668 'localizable' => 0,
669 'html' => [
670 'type' => 'CheckBox',
671 ],
672 ],
673 ];
674 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
675 }
676 return Civi::$statics[__CLASS__]['fields'];
677 }
678
679 /**
680 * Return a mapping from field-name to the corresponding key (as used in fields()).
681 *
682 * @return array
683 * Array(string $name => string $uniqueName).
684 */
685 public static function &fieldKeys() {
686 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
687 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
688 }
689 return Civi::$statics[__CLASS__]['fieldKeys'];
690 }
691
692 /**
693 * Returns the names of this table
694 *
695 * @return string
696 */
697 public static function getTableName() {
698 return self::$_tableName;
699 }
700
701 /**
702 * Returns if this table needs to be logged
703 *
704 * @return bool
705 */
706 public function getLog() {
707 return self::$_log;
708 }
709
710 /**
711 * Returns the list of fields that can be imported
712 *
713 * @param bool $prefix
714 *
715 * @return array
716 */
717 public static function &import($prefix = FALSE) {
718 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution_recur', $prefix, []);
719 return $r;
720 }
721
722 /**
723 * Returns the list of fields that can be exported
724 *
725 * @param bool $prefix
726 *
727 * @return array
728 */
729 public static function &export($prefix = FALSE) {
730 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution_recur', $prefix, []);
731 return $r;
732 }
733
734 /**
735 * Returns the list of indices
736 *
737 * @param bool $localize
738 *
739 * @return array
740 */
741 public static function indices($localize = TRUE) {
742 $indices = [
743 'UI_contrib_trxn_id' => [
744 'name' => 'UI_contrib_trxn_id',
745 'field' => [
746 0 => 'trxn_id',
747 ],
748 'localizable' => FALSE,
749 'unique' => TRUE,
750 'sig' => 'civicrm_contribution_recur::1::trxn_id',
751 ],
752 'UI_contrib_invoice_id' => [
753 'name' => 'UI_contrib_invoice_id',
754 'field' => [
755 0 => 'invoice_id',
756 ],
757 'localizable' => FALSE,
758 'unique' => TRUE,
759 'sig' => 'civicrm_contribution_recur::1::invoice_id',
760 ],
761 'index_contribution_status' => [
762 'name' => 'index_contribution_status',
763 'field' => [
764 0 => 'contribution_status_id',
765 ],
766 'localizable' => FALSE,
767 'sig' => 'civicrm_contribution_recur::0::contribution_status_id',
768 ],
769 'UI_contribution_recur_payment_instrument_id' => [
770 'name' => 'UI_contribution_recur_payment_instrument_id',
771 'field' => [
772 0 => 'payment_instrument_id',
773 ],
774 'localizable' => FALSE,
775 'sig' => 'civicrm_contribution_recur::0::payment_instrument_id',
776 ],
777 ];
778 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
779 }
780
781 }