Merge pull request #11635 from civicrm/4.7.30-rc
[civicrm-core.git] / CRM / Contribute / DAO / ContributionPage.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2017
6 *
7 * Generated from xml/schema/CRM/Contribute/ContributionPage.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:2bc7d9380c552fe9995f8403f757cd09)
10 */
11
12 /**
13 * Database access object for the ContributionPage entity.
14 */
15 class CRM_Contribute_DAO_ContributionPage extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_contribution_page';
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 Id
33 *
34 * @var int unsigned
35 */
36 public $id;
37
38 /**
39 * Contribution Page title. For top of page display
40 *
41 * @var string
42 */
43 public $title;
44
45 /**
46 * Text and html allowed. Displayed below title.
47 *
48 * @var text
49 */
50 public $intro_text;
51
52 /**
53 * default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution
54 *
55 * @var int unsigned
56 */
57 public $financial_type_id;
58
59 /**
60 * Payment Processors configured for this contribution Page
61 *
62 * @var string
63 */
64 public $payment_processor;
65
66 /**
67 * if true - processing logic must reject transaction at confirmation stage if pay method != credit card
68 *
69 * @var boolean
70 */
71 public $is_credit_card_only;
72
73 /**
74 * if true - allows real-time monetary transactions otherwise non-monetary transactions
75 *
76 * @var boolean
77 */
78 public $is_monetary;
79
80 /**
81 * if true - allows recurring contributions, valid only for PayPal_Standard
82 *
83 * @var boolean
84 */
85 public $is_recur;
86
87 /**
88 * if false, the confirm page in contribution pages gets skipped
89 *
90 * @var boolean
91 */
92 public $is_confirm_enabled;
93
94 /**
95 * Supported recurring frequency units.
96 *
97 * @var string
98 */
99 public $recur_frequency_unit;
100
101 /**
102 * if true - supports recurring intervals
103 *
104 * @var boolean
105 */
106 public $is_recur_interval;
107
108 /**
109 * if true - asks user for recurring installments
110 *
111 * @var boolean
112 */
113 public $is_recur_installments;
114
115 /**
116 * if true - user is able to adjust payment start date
117 *
118 * @var boolean
119 */
120 public $adjust_recur_start_date;
121
122 /**
123 * if true - allows the user to send payment directly to the org later
124 *
125 * @var boolean
126 */
127 public $is_pay_later;
128
129 /**
130 * The text displayed to the user in the main form
131 *
132 * @var text
133 */
134 public $pay_later_text;
135
136 /**
137 * The receipt sent to the user instead of the normal receipt text
138 *
139 * @var text
140 */
141 public $pay_later_receipt;
142
143 /**
144 * is partial payment enabled for this online contribution page
145 *
146 * @var boolean
147 */
148 public $is_partial_payment;
149
150 /**
151 * Initial amount label for partial payment
152 *
153 * @var string
154 */
155 public $initial_amount_label;
156
157 /**
158 * Initial amount help text for partial payment
159 *
160 * @var text
161 */
162 public $initial_amount_help_text;
163
164 /**
165 * Minimum initial amount for partial payment
166 *
167 * @var float
168 */
169 public $min_initial_amount;
170
171 /**
172 * if true, page will include an input text field where user can enter their own amount
173 *
174 * @var boolean
175 */
176 public $is_allow_other_amount;
177
178 /**
179 * FK to civicrm_option_value.
180 *
181 * @var int unsigned
182 */
183 public $default_amount_id;
184
185 /**
186 * if other amounts allowed, user can configure minimum allowed.
187 *
188 * @var float
189 */
190 public $min_amount;
191
192 /**
193 * if other amounts allowed, user can configure maximum allowed.
194 *
195 * @var float
196 */
197 public $max_amount;
198
199 /**
200 * The target goal for this page, allows people to build a goal meter
201 *
202 * @var float
203 */
204 public $goal_amount;
205
206 /**
207 * Title for Thank-you page (header title tag, and display at the top of the page).
208 *
209 * @var string
210 */
211 public $thankyou_title;
212
213 /**
214 * text and html allowed. displayed above result on success page
215 *
216 * @var text
217 */
218 public $thankyou_text;
219
220 /**
221 * Text and html allowed. displayed at the bottom of the success page. Common usage is to include link(s) to other pages such as tell-a-friend, etc.
222 *
223 * @var text
224 */
225 public $thankyou_footer;
226
227 /**
228 * if true, receipt is automatically emailed to contact on success
229 *
230 * @var boolean
231 */
232 public $is_email_receipt;
233
234 /**
235 * FROM email name used for receipts generated by contributions to this contribution page.
236 *
237 * @var string
238 */
239 public $receipt_from_name;
240
241 /**
242 * FROM email address used for receipts generated by contributions to this contribution page.
243 *
244 * @var string
245 */
246 public $receipt_from_email;
247
248 /**
249 * comma-separated list of email addresses to cc each time a receipt is sent
250 *
251 * @var string
252 */
253 public $cc_receipt;
254
255 /**
256 * comma-separated list of email addresses to bcc each time a receipt is sent
257 *
258 * @var string
259 */
260 public $bcc_receipt;
261
262 /**
263 * text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now
264 *
265 * @var text
266 */
267 public $receipt_text;
268
269 /**
270 * Is this property active?
271 *
272 * @var boolean
273 */
274 public $is_active;
275
276 /**
277 * Text and html allowed. Displayed at the bottom of the first page of the contribution wizard.
278 *
279 * @var text
280 */
281 public $footer_text;
282
283 /**
284 * Is this property active?
285 *
286 * @var boolean
287 */
288 public $amount_block_is_active;
289
290 /**
291 * Date and time that this page starts.
292 *
293 * @var datetime
294 */
295 public $start_date;
296
297 /**
298 * Date and time that this page ends. May be NULL if no defined end date/time
299 *
300 * @var datetime
301 */
302 public $end_date;
303
304 /**
305 * FK to civicrm_contact, who created this contribution page
306 *
307 * @var int unsigned
308 */
309 public $created_id;
310
311 /**
312 * Date and time that contribution page was created.
313 *
314 * @var datetime
315 */
316 public $created_date;
317
318 /**
319 * 3 character string, value from config setting or input via user.
320 *
321 * @var string
322 */
323 public $currency;
324
325 /**
326 * The campaign for which we are collecting contributions with this page.
327 *
328 * @var int unsigned
329 */
330 public $campaign_id;
331
332 /**
333 * Can people share the contribution page through social media?
334 *
335 * @var boolean
336 */
337 public $is_share;
338
339 /**
340 * if true - billing block is required for online contribution page
341 *
342 * @var boolean
343 */
344 public $is_billing_required;
345
346 /**
347 * Class constructor.
348 */
349 public function __construct() {
350 $this->__table = 'civicrm_contribution_page';
351 parent::__construct();
352 }
353
354 /**
355 * Returns foreign keys and entity references.
356 *
357 * @return array
358 * [CRM_Core_Reference_Interface]
359 */
360 public static function getReferenceColumns() {
361 if (!isset(Civi::$statics[__CLASS__]['links'])) {
362 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
363 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'financial_type_id', 'civicrm_financial_type', 'id');
364 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id');
365 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'campaign_id', 'civicrm_campaign', 'id');
366 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
367 }
368 return Civi::$statics[__CLASS__]['links'];
369 }
370
371 /**
372 * Returns all the column names of this table
373 *
374 * @return array
375 */
376 public static function &fields() {
377 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
378 Civi::$statics[__CLASS__]['fields'] = [
379 'id' => [
380 'name' => 'id',
381 'type' => CRM_Utils_Type::T_INT,
382 'title' => ts('Contribution Page ID'),
383 'description' => 'Contribution Id',
384 'required' => TRUE,
385 'table_name' => 'civicrm_contribution_page',
386 'entity' => 'ContributionPage',
387 'bao' => 'CRM_Contribute_BAO_ContributionPage',
388 'localizable' => 0,
389 ],
390 'title' => [
391 'name' => 'title',
392 'type' => CRM_Utils_Type::T_STRING,
393 'title' => ts('Contribution Page Title'),
394 'description' => 'Contribution Page title. For top of page display',
395 'maxlength' => 255,
396 'size' => CRM_Utils_Type::HUGE,
397 'table_name' => 'civicrm_contribution_page',
398 'entity' => 'ContributionPage',
399 'bao' => 'CRM_Contribute_BAO_ContributionPage',
400 'localizable' => 1,
401 ],
402 'intro_text' => [
403 'name' => 'intro_text',
404 'type' => CRM_Utils_Type::T_TEXT,
405 'title' => ts('Contribution Page Introduction Text'),
406 'description' => 'Text and html allowed. Displayed below title.',
407 'rows' => 6,
408 'cols' => 50,
409 'table_name' => 'civicrm_contribution_page',
410 'entity' => 'ContributionPage',
411 'bao' => 'CRM_Contribute_BAO_ContributionPage',
412 'localizable' => 1,
413 'html' => [
414 'type' => 'RichTextEditor',
415 ],
416 ],
417 'financial_type_id' => [
418 'name' => 'financial_type_id',
419 'type' => CRM_Utils_Type::T_INT,
420 'title' => ts('Financial Type'),
421 'description' => 'default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution',
422 'table_name' => 'civicrm_contribution_page',
423 'entity' => 'ContributionPage',
424 'bao' => 'CRM_Contribute_BAO_ContributionPage',
425 'localizable' => 0,
426 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
427 'html' => [
428 'type' => 'Select',
429 ],
430 'pseudoconstant' => [
431 'table' => 'civicrm_financial_type',
432 'keyColumn' => 'id',
433 'labelColumn' => 'name',
434 ]
435 ],
436 'payment_processor' => [
437 'name' => 'payment_processor',
438 'type' => CRM_Utils_Type::T_STRING,
439 'title' => ts('Payment Processor'),
440 'description' => 'Payment Processors configured for this contribution Page',
441 'maxlength' => 128,
442 'size' => CRM_Utils_Type::HUGE,
443 'table_name' => 'civicrm_contribution_page',
444 'entity' => 'ContributionPage',
445 'bao' => 'CRM_Contribute_BAO_ContributionPage',
446 'localizable' => 0,
447 'html' => [
448 'type' => 'Select',
449 ],
450 'pseudoconstant' => [
451 'table' => 'civicrm_payment_processor',
452 'keyColumn' => 'id',
453 'labelColumn' => 'name',
454 ]
455 ],
456 'is_credit_card_only' => [
457 'name' => 'is_credit_card_only',
458 'type' => CRM_Utils_Type::T_BOOLEAN,
459 'title' => ts('Is Credit Card Only?'),
460 'description' => 'if true - processing logic must reject transaction at confirmation stage if pay method != credit card',
461 'table_name' => 'civicrm_contribution_page',
462 'entity' => 'ContributionPage',
463 'bao' => 'CRM_Contribute_BAO_ContributionPage',
464 'localizable' => 0,
465 ],
466 'is_monetary' => [
467 'name' => 'is_monetary',
468 'type' => CRM_Utils_Type::T_BOOLEAN,
469 'title' => ts('Is Monetary'),
470 'description' => 'if true - allows real-time monetary transactions otherwise non-monetary transactions',
471 'default' => '1',
472 'table_name' => 'civicrm_contribution_page',
473 'entity' => 'ContributionPage',
474 'bao' => 'CRM_Contribute_BAO_ContributionPage',
475 'localizable' => 0,
476 ],
477 'is_recur' => [
478 'name' => 'is_recur',
479 'type' => CRM_Utils_Type::T_BOOLEAN,
480 'title' => ts('Is Recurring'),
481 'description' => 'if true - allows recurring contributions, valid only for PayPal_Standard',
482 'table_name' => 'civicrm_contribution_page',
483 'entity' => 'ContributionPage',
484 'bao' => 'CRM_Contribute_BAO_ContributionPage',
485 'localizable' => 0,
486 ],
487 'is_confirm_enabled' => [
488 'name' => 'is_confirm_enabled',
489 'type' => CRM_Utils_Type::T_BOOLEAN,
490 'title' => ts('Confirmation Page?'),
491 'description' => 'if false, the confirm page in contribution pages gets skipped',
492 'default' => '1',
493 'table_name' => 'civicrm_contribution_page',
494 'entity' => 'ContributionPage',
495 'bao' => 'CRM_Contribute_BAO_ContributionPage',
496 'localizable' => 0,
497 ],
498 'recur_frequency_unit' => [
499 'name' => 'recur_frequency_unit',
500 'type' => CRM_Utils_Type::T_STRING,
501 'title' => ts('Recurring Frequency'),
502 'description' => 'Supported recurring frequency units.',
503 'maxlength' => 128,
504 'size' => CRM_Utils_Type::HUGE,
505 'table_name' => 'civicrm_contribution_page',
506 'entity' => 'ContributionPage',
507 'bao' => 'CRM_Contribute_BAO_ContributionPage',
508 'localizable' => 0,
509 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
510 'html' => [
511 'type' => 'Select',
512 ],
513 'pseudoconstant' => [
514 'optionGroupName' => 'recur_frequency_units',
515 'keyColumn' => 'name',
516 'optionEditPath' => 'civicrm/admin/options/recur_frequency_units',
517 ]
518 ],
519 'is_recur_interval' => [
520 'name' => 'is_recur_interval',
521 'type' => CRM_Utils_Type::T_BOOLEAN,
522 'title' => ts('Support Recurring Intervals'),
523 'description' => 'if true - supports recurring intervals',
524 'table_name' => 'civicrm_contribution_page',
525 'entity' => 'ContributionPage',
526 'bao' => 'CRM_Contribute_BAO_ContributionPage',
527 'localizable' => 0,
528 ],
529 'is_recur_installments' => [
530 'name' => 'is_recur_installments',
531 'type' => CRM_Utils_Type::T_BOOLEAN,
532 'title' => ts('Recurring Installments?'),
533 'description' => 'if true - asks user for recurring installments',
534 'table_name' => 'civicrm_contribution_page',
535 'entity' => 'ContributionPage',
536 'bao' => 'CRM_Contribute_BAO_ContributionPage',
537 'localizable' => 0,
538 ],
539 'adjust_recur_start_date' => [
540 'name' => 'adjust_recur_start_date',
541 'type' => CRM_Utils_Type::T_BOOLEAN,
542 'title' => ts('Adjust Recurring Start Date'),
543 'description' => 'if true - user is able to adjust payment start date',
544 'table_name' => 'civicrm_contribution_page',
545 'entity' => 'ContributionPage',
546 'bao' => 'CRM_Contribute_BAO_ContributionPage',
547 'localizable' => 0,
548 ],
549 'is_pay_later' => [
550 'name' => 'is_pay_later',
551 'type' => CRM_Utils_Type::T_BOOLEAN,
552 'title' => ts('Pay Later'),
553 'description' => 'if true - allows the user to send payment directly to the org later',
554 'table_name' => 'civicrm_contribution_page',
555 'entity' => 'ContributionPage',
556 'bao' => 'CRM_Contribute_BAO_ContributionPage',
557 'localizable' => 0,
558 ],
559 'pay_later_text' => [
560 'name' => 'pay_later_text',
561 'type' => CRM_Utils_Type::T_TEXT,
562 'title' => ts('Pay Later Text'),
563 'description' => 'The text displayed to the user in the main form',
564 'table_name' => 'civicrm_contribution_page',
565 'entity' => 'ContributionPage',
566 'bao' => 'CRM_Contribute_BAO_ContributionPage',
567 'localizable' => 1,
568 ],
569 'pay_later_receipt' => [
570 'name' => 'pay_later_receipt',
571 'type' => CRM_Utils_Type::T_TEXT,
572 'title' => ts('Pay Later Receipt'),
573 'description' => 'The receipt sent to the user instead of the normal receipt text',
574 'table_name' => 'civicrm_contribution_page',
575 'entity' => 'ContributionPage',
576 'bao' => 'CRM_Contribute_BAO_ContributionPage',
577 'localizable' => 1,
578 ],
579 'is_partial_payment' => [
580 'name' => 'is_partial_payment',
581 'type' => CRM_Utils_Type::T_BOOLEAN,
582 'title' => ts('Allow Partial Payment'),
583 'description' => 'is partial payment enabled for this online contribution page',
584 'table_name' => 'civicrm_contribution_page',
585 'entity' => 'ContributionPage',
586 'bao' => 'CRM_Contribute_BAO_ContributionPage',
587 'localizable' => 0,
588 ],
589 'initial_amount_label' => [
590 'name' => 'initial_amount_label',
591 'type' => CRM_Utils_Type::T_STRING,
592 'title' => ts('Initial Amount Label'),
593 'description' => 'Initial amount label for partial payment',
594 'maxlength' => 255,
595 'size' => CRM_Utils_Type::HUGE,
596 'table_name' => 'civicrm_contribution_page',
597 'entity' => 'ContributionPage',
598 'bao' => 'CRM_Contribute_BAO_ContributionPage',
599 'localizable' => 1,
600 ],
601 'initial_amount_help_text' => [
602 'name' => 'initial_amount_help_text',
603 'type' => CRM_Utils_Type::T_TEXT,
604 'title' => ts('Initial Amount Help Text'),
605 'description' => 'Initial amount help text for partial payment',
606 'table_name' => 'civicrm_contribution_page',
607 'entity' => 'ContributionPage',
608 'bao' => 'CRM_Contribute_BAO_ContributionPage',
609 'localizable' => 1,
610 ],
611 'min_initial_amount' => [
612 'name' => 'min_initial_amount',
613 'type' => CRM_Utils_Type::T_MONEY,
614 'title' => ts('Min Initial Amount'),
615 'description' => 'Minimum initial amount for partial payment',
616 'precision' => [
617 20,
618 2
619 ],
620 'table_name' => 'civicrm_contribution_page',
621 'entity' => 'ContributionPage',
622 'bao' => 'CRM_Contribute_BAO_ContributionPage',
623 'localizable' => 0,
624 ],
625 'is_allow_other_amount' => [
626 'name' => 'is_allow_other_amount',
627 'type' => CRM_Utils_Type::T_BOOLEAN,
628 'title' => ts('Allow Other Amounts'),
629 'description' => 'if true, page will include an input text field where user can enter their own amount',
630 'table_name' => 'civicrm_contribution_page',
631 'entity' => 'ContributionPage',
632 'bao' => 'CRM_Contribute_BAO_ContributionPage',
633 'localizable' => 0,
634 ],
635 'default_amount_id' => [
636 'name' => 'default_amount_id',
637 'type' => CRM_Utils_Type::T_INT,
638 'title' => ts('Default Amount'),
639 'description' => 'FK to civicrm_option_value.',
640 'table_name' => 'civicrm_contribution_page',
641 'entity' => 'ContributionPage',
642 'bao' => 'CRM_Contribute_BAO_ContributionPage',
643 'localizable' => 0,
644 ],
645 'min_amount' => [
646 'name' => 'min_amount',
647 'type' => CRM_Utils_Type::T_MONEY,
648 'title' => ts('Minimum Amount'),
649 'description' => 'if other amounts allowed, user can configure minimum allowed.',
650 'precision' => [
651 20,
652 2
653 ],
654 'table_name' => 'civicrm_contribution_page',
655 'entity' => 'ContributionPage',
656 'bao' => 'CRM_Contribute_BAO_ContributionPage',
657 'localizable' => 0,
658 ],
659 'max_amount' => [
660 'name' => 'max_amount',
661 'type' => CRM_Utils_Type::T_MONEY,
662 'title' => ts('Maximum Amount'),
663 'description' => 'if other amounts allowed, user can configure maximum allowed.',
664 'precision' => [
665 20,
666 2
667 ],
668 'table_name' => 'civicrm_contribution_page',
669 'entity' => 'ContributionPage',
670 'bao' => 'CRM_Contribute_BAO_ContributionPage',
671 'localizable' => 0,
672 ],
673 'goal_amount' => [
674 'name' => 'goal_amount',
675 'type' => CRM_Utils_Type::T_MONEY,
676 'title' => ts('Goal Amount'),
677 'description' => 'The target goal for this page, allows people to build a goal meter',
678 'precision' => [
679 20,
680 2
681 ],
682 'table_name' => 'civicrm_contribution_page',
683 'entity' => 'ContributionPage',
684 'bao' => 'CRM_Contribute_BAO_ContributionPage',
685 'localizable' => 0,
686 ],
687 'thankyou_title' => [
688 'name' => 'thankyou_title',
689 'type' => CRM_Utils_Type::T_STRING,
690 'title' => ts('Thank-you Title'),
691 'description' => 'Title for Thank-you page (header title tag, and display at the top of the page).',
692 'maxlength' => 255,
693 'size' => CRM_Utils_Type::HUGE,
694 'table_name' => 'civicrm_contribution_page',
695 'entity' => 'ContributionPage',
696 'bao' => 'CRM_Contribute_BAO_ContributionPage',
697 'localizable' => 1,
698 ],
699 'thankyou_text' => [
700 'name' => 'thankyou_text',
701 'type' => CRM_Utils_Type::T_TEXT,
702 'title' => ts('Thank-you Text'),
703 'description' => 'text and html allowed. displayed above result on success page',
704 'rows' => 8,
705 'cols' => 60,
706 'table_name' => 'civicrm_contribution_page',
707 'entity' => 'ContributionPage',
708 'bao' => 'CRM_Contribute_BAO_ContributionPage',
709 'localizable' => 1,
710 'html' => [
711 'type' => 'RichTextEditor',
712 ],
713 ],
714 'thankyou_footer' => [
715 'name' => 'thankyou_footer',
716 'type' => CRM_Utils_Type::T_TEXT,
717 'title' => ts('Thank-you Footer'),
718 'description' => 'Text and html allowed. displayed at the bottom of the success page. Common usage is to include link(s) to other pages such as tell-a-friend, etc.',
719 'rows' => 8,
720 'cols' => 60,
721 'table_name' => 'civicrm_contribution_page',
722 'entity' => 'ContributionPage',
723 'bao' => 'CRM_Contribute_BAO_ContributionPage',
724 'localizable' => 1,
725 'html' => [
726 'type' => 'RichTextEditor',
727 ],
728 ],
729 'is_email_receipt' => [
730 'name' => 'is_email_receipt',
731 'type' => CRM_Utils_Type::T_BOOLEAN,
732 'title' => ts('Send email Receipt'),
733 'description' => 'if true, receipt is automatically emailed to contact on success',
734 'table_name' => 'civicrm_contribution_page',
735 'entity' => 'ContributionPage',
736 'bao' => 'CRM_Contribute_BAO_ContributionPage',
737 'localizable' => 0,
738 ],
739 'receipt_from_name' => [
740 'name' => 'receipt_from_name',
741 'type' => CRM_Utils_Type::T_STRING,
742 'title' => ts('Receipt From'),
743 'description' => 'FROM email name used for receipts generated by contributions to this contribution page.',
744 'maxlength' => 255,
745 'size' => CRM_Utils_Type::HUGE,
746 'table_name' => 'civicrm_contribution_page',
747 'entity' => 'ContributionPage',
748 'bao' => 'CRM_Contribute_BAO_ContributionPage',
749 'localizable' => 1,
750 ],
751 'receipt_from_email' => [
752 'name' => 'receipt_from_email',
753 'type' => CRM_Utils_Type::T_STRING,
754 'title' => ts('Receipt From email'),
755 'description' => 'FROM email address used for receipts generated by contributions to this contribution page.',
756 'maxlength' => 255,
757 'size' => CRM_Utils_Type::HUGE,
758 'table_name' => 'civicrm_contribution_page',
759 'entity' => 'ContributionPage',
760 'bao' => 'CRM_Contribute_BAO_ContributionPage',
761 'localizable' => 0,
762 ],
763 'cc_receipt' => [
764 'name' => 'cc_receipt',
765 'type' => CRM_Utils_Type::T_STRING,
766 'title' => ts('Receipt cc'),
767 'description' => 'comma-separated list of email addresses to cc each time a receipt is sent',
768 'maxlength' => 255,
769 'size' => CRM_Utils_Type::HUGE,
770 'table_name' => 'civicrm_contribution_page',
771 'entity' => 'ContributionPage',
772 'bao' => 'CRM_Contribute_BAO_ContributionPage',
773 'localizable' => 0,
774 ],
775 'bcc_receipt' => [
776 'name' => 'bcc_receipt',
777 'type' => CRM_Utils_Type::T_STRING,
778 'title' => ts('Receipt bcc'),
779 'description' => 'comma-separated list of email addresses to bcc each time a receipt is sent',
780 'maxlength' => 255,
781 'size' => CRM_Utils_Type::HUGE,
782 'table_name' => 'civicrm_contribution_page',
783 'entity' => 'ContributionPage',
784 'bao' => 'CRM_Contribute_BAO_ContributionPage',
785 'localizable' => 0,
786 ],
787 'receipt_text' => [
788 'name' => 'receipt_text',
789 'type' => CRM_Utils_Type::T_TEXT,
790 'title' => ts('Receipt Text'),
791 'description' => 'text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now',
792 'rows' => 6,
793 'cols' => 50,
794 'table_name' => 'civicrm_contribution_page',
795 'entity' => 'ContributionPage',
796 'bao' => 'CRM_Contribute_BAO_ContributionPage',
797 'localizable' => 1,
798 'html' => [
799 'type' => 'TextArea',
800 ],
801 ],
802 'is_active' => [
803 'name' => 'is_active',
804 'type' => CRM_Utils_Type::T_BOOLEAN,
805 'title' => ts('Is Page Active?'),
806 'description' => 'Is this property active?',
807 'table_name' => 'civicrm_contribution_page',
808 'entity' => 'ContributionPage',
809 'bao' => 'CRM_Contribute_BAO_ContributionPage',
810 'localizable' => 0,
811 ],
812 'footer_text' => [
813 'name' => 'footer_text',
814 'type' => CRM_Utils_Type::T_TEXT,
815 'title' => ts('Footer Text'),
816 'description' => 'Text and html allowed. Displayed at the bottom of the first page of the contribution wizard.',
817 'rows' => 6,
818 'cols' => 50,
819 'table_name' => 'civicrm_contribution_page',
820 'entity' => 'ContributionPage',
821 'bao' => 'CRM_Contribute_BAO_ContributionPage',
822 'localizable' => 1,
823 'html' => [
824 'type' => 'RichTextEditor',
825 ],
826 ],
827 'amount_block_is_active' => [
828 'name' => 'amount_block_is_active',
829 'type' => CRM_Utils_Type::T_BOOLEAN,
830 'title' => ts('Is Amount Block Active?'),
831 'description' => 'Is this property active?',
832 'default' => '1',
833 'table_name' => 'civicrm_contribution_page',
834 'entity' => 'ContributionPage',
835 'bao' => 'CRM_Contribute_BAO_ContributionPage',
836 'localizable' => 0,
837 ],
838 'start_date' => [
839 'name' => 'start_date',
840 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
841 'title' => ts('Contribution Page Start Date'),
842 'description' => 'Date and time that this page starts.',
843 'table_name' => 'civicrm_contribution_page',
844 'entity' => 'ContributionPage',
845 'bao' => 'CRM_Contribute_BAO_ContributionPage',
846 'localizable' => 0,
847 ],
848 'end_date' => [
849 'name' => 'end_date',
850 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
851 'title' => ts('Contribution Page End Date'),
852 'description' => 'Date and time that this page ends. May be NULL if no defined end date/time',
853 'table_name' => 'civicrm_contribution_page',
854 'entity' => 'ContributionPage',
855 'bao' => 'CRM_Contribute_BAO_ContributionPage',
856 'localizable' => 0,
857 ],
858 'created_id' => [
859 'name' => 'created_id',
860 'type' => CRM_Utils_Type::T_INT,
861 'title' => ts('Contribution Page Created By'),
862 'description' => 'FK to civicrm_contact, who created this contribution page',
863 'table_name' => 'civicrm_contribution_page',
864 'entity' => 'ContributionPage',
865 'bao' => 'CRM_Contribute_BAO_ContributionPage',
866 'localizable' => 0,
867 'FKClassName' => 'CRM_Contact_DAO_Contact',
868 ],
869 'created_date' => [
870 'name' => 'created_date',
871 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
872 'title' => ts('Contribution Page Created Date'),
873 'description' => 'Date and time that contribution page was created.',
874 'table_name' => 'civicrm_contribution_page',
875 'entity' => 'ContributionPage',
876 'bao' => 'CRM_Contribute_BAO_ContributionPage',
877 'localizable' => 0,
878 ],
879 'currency' => [
880 'name' => 'currency',
881 'type' => CRM_Utils_Type::T_STRING,
882 'title' => ts('Contribution Page Currency'),
883 'description' => '3 character string, value from config setting or input via user.',
884 'maxlength' => 3,
885 'size' => CRM_Utils_Type::FOUR,
886 'default' => 'NULL',
887 'table_name' => 'civicrm_contribution_page',
888 'entity' => 'ContributionPage',
889 'bao' => 'CRM_Contribute_BAO_ContributionPage',
890 'localizable' => 0,
891 'html' => [
892 'type' => 'Select',
893 ],
894 'pseudoconstant' => [
895 'table' => 'civicrm_currency',
896 'keyColumn' => 'name',
897 'labelColumn' => 'full_name',
898 'nameColumn' => 'name',
899 ]
900 ],
901 'campaign_id' => [
902 'name' => 'campaign_id',
903 'type' => CRM_Utils_Type::T_INT,
904 'title' => ts('Contribution Page Campaign ID'),
905 'description' => 'The campaign for which we are collecting contributions with this page.',
906 'table_name' => 'civicrm_contribution_page',
907 'entity' => 'ContributionPage',
908 'bao' => 'CRM_Contribute_BAO_ContributionPage',
909 'localizable' => 0,
910 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
911 'pseudoconstant' => [
912 'table' => 'civicrm_campaign',
913 'keyColumn' => 'id',
914 'labelColumn' => 'title',
915 ]
916 ],
917 'is_share' => [
918 'name' => 'is_share',
919 'type' => CRM_Utils_Type::T_BOOLEAN,
920 'title' => ts('Is Contribution Page Shared?'),
921 'description' => 'Can people share the contribution page through social media?',
922 'default' => '1',
923 'table_name' => 'civicrm_contribution_page',
924 'entity' => 'ContributionPage',
925 'bao' => 'CRM_Contribute_BAO_ContributionPage',
926 'localizable' => 0,
927 ],
928 'is_billing_required' => [
929 'name' => 'is_billing_required',
930 'type' => CRM_Utils_Type::T_BOOLEAN,
931 'title' => ts('Is billing block required'),
932 'description' => 'if true - billing block is required for online contribution page',
933 'table_name' => 'civicrm_contribution_page',
934 'entity' => 'ContributionPage',
935 'bao' => 'CRM_Contribute_BAO_ContributionPage',
936 'localizable' => 0,
937 ],
938 ];
939 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
940 }
941 return Civi::$statics[__CLASS__]['fields'];
942 }
943
944 /**
945 * Return a mapping from field-name to the corresponding key (as used in fields()).
946 *
947 * @return array
948 * Array(string $name => string $uniqueName).
949 */
950 public static function &fieldKeys() {
951 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
952 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
953 }
954 return Civi::$statics[__CLASS__]['fieldKeys'];
955 }
956
957 /**
958 * Returns the names of this table
959 *
960 * @return string
961 */
962 public static function getTableName() {
963 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
964 }
965
966 /**
967 * Returns if this table needs to be logged
968 *
969 * @return bool
970 */
971 public function getLog() {
972 return self::$_log;
973 }
974
975 /**
976 * Returns the list of fields that can be imported
977 *
978 * @param bool $prefix
979 *
980 * @return array
981 */
982 public static function &import($prefix = FALSE) {
983 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution_page', $prefix, []);
984 return $r;
985 }
986
987 /**
988 * Returns the list of fields that can be exported
989 *
990 * @param bool $prefix
991 *
992 * @return array
993 */
994 public static function &export($prefix = FALSE) {
995 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution_page', $prefix, []);
996 return $r;
997 }
998
999 /**
1000 * Returns the list of indices
1001 *
1002 * @param bool $localize
1003 *
1004 * @return array
1005 */
1006 public static function indices($localize = TRUE) {
1007 $indices = [];
1008 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
1009 }
1010
1011 }