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