adc5656538a1e66d38f207f99257e94f4165c937
[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:a8f42298c3fbe5b8c1986c81d77a8a0f)
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 'add' => '1.3',
418 ],
419 'title' => [
420 'name' => 'title',
421 'type' => CRM_Utils_Type::T_STRING,
422 'title' => ts('Contribution Page Title'),
423 'description' => ts('Contribution Page title. For top of page display'),
424 'maxlength' => 255,
425 'size' => CRM_Utils_Type::HUGE,
426 'where' => 'civicrm_contribution_page.title',
427 'table_name' => 'civicrm_contribution_page',
428 'entity' => 'ContributionPage',
429 'bao' => 'CRM_Contribute_BAO_ContributionPage',
430 'localizable' => 1,
431 'add' => '1.3',
432 ],
433 'intro_text' => [
434 'name' => 'intro_text',
435 'type' => CRM_Utils_Type::T_TEXT,
436 'title' => ts('Contribution Page Introduction Text'),
437 'description' => ts('Text and html allowed. Displayed below title.'),
438 'rows' => 6,
439 'cols' => 50,
440 'where' => 'civicrm_contribution_page.intro_text',
441 'table_name' => 'civicrm_contribution_page',
442 'entity' => 'ContributionPage',
443 'bao' => 'CRM_Contribute_BAO_ContributionPage',
444 'localizable' => 1,
445 'html' => [
446 'type' => 'RichTextEditor',
447 ],
448 'add' => '1.3',
449 ],
450 'financial_type_id' => [
451 'name' => 'financial_type_id',
452 'type' => CRM_Utils_Type::T_INT,
453 'title' => ts('Financial Type'),
454 'description' => ts('default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution'),
455 'where' => 'civicrm_contribution_page.financial_type_id',
456 'table_name' => 'civicrm_contribution_page',
457 'entity' => 'ContributionPage',
458 'bao' => 'CRM_Contribute_BAO_ContributionPage',
459 'localizable' => 0,
460 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
461 'html' => [
462 'type' => 'Select',
463 ],
464 'pseudoconstant' => [
465 'table' => 'civicrm_financial_type',
466 'keyColumn' => 'id',
467 'labelColumn' => 'name',
468 ],
469 'add' => '4.3',
470 ],
471 'payment_processor' => [
472 'name' => 'payment_processor',
473 'type' => CRM_Utils_Type::T_STRING,
474 'title' => ts('Payment Processor'),
475 'description' => ts('Payment Processors configured for this contribution Page'),
476 'maxlength' => 128,
477 'size' => CRM_Utils_Type::HUGE,
478 'where' => 'civicrm_contribution_page.payment_processor',
479 'table_name' => 'civicrm_contribution_page',
480 'entity' => 'ContributionPage',
481 'bao' => 'CRM_Contribute_BAO_ContributionPage',
482 'localizable' => 0,
483 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
484 'html' => [
485 'type' => 'Select',
486 ],
487 'pseudoconstant' => [
488 'table' => 'civicrm_payment_processor',
489 'keyColumn' => 'id',
490 'labelColumn' => 'name',
491 ],
492 'add' => '1.8',
493 ],
494 'is_credit_card_only' => [
495 'name' => 'is_credit_card_only',
496 'type' => CRM_Utils_Type::T_BOOLEAN,
497 'title' => ts('Is Credit Card Only?'),
498 'description' => ts('if true - processing logic must reject transaction at confirmation stage if pay method != credit card'),
499 'where' => 'civicrm_contribution_page.is_credit_card_only',
500 'default' => '0',
501 'table_name' => 'civicrm_contribution_page',
502 'entity' => 'ContributionPage',
503 'bao' => 'CRM_Contribute_BAO_ContributionPage',
504 'localizable' => 0,
505 'add' => '1.3',
506 ],
507 'is_monetary' => [
508 'name' => 'is_monetary',
509 'type' => CRM_Utils_Type::T_BOOLEAN,
510 'title' => ts('Is Monetary'),
511 'description' => ts('if true - allows real-time monetary transactions otherwise non-monetary transactions'),
512 'where' => 'civicrm_contribution_page.is_monetary',
513 'default' => '1',
514 'table_name' => 'civicrm_contribution_page',
515 'entity' => 'ContributionPage',
516 'bao' => 'CRM_Contribute_BAO_ContributionPage',
517 'localizable' => 0,
518 'add' => '1.6',
519 ],
520 'is_recur' => [
521 'name' => 'is_recur',
522 'type' => CRM_Utils_Type::T_BOOLEAN,
523 'title' => ts('Is Recurring'),
524 'description' => ts('if true - allows recurring contributions, valid only for PayPal_Standard'),
525 'where' => 'civicrm_contribution_page.is_recur',
526 'default' => '0',
527 'table_name' => 'civicrm_contribution_page',
528 'entity' => 'ContributionPage',
529 'bao' => 'CRM_Contribute_BAO_ContributionPage',
530 'localizable' => 0,
531 'add' => '1.6',
532 ],
533 'is_confirm_enabled' => [
534 'name' => 'is_confirm_enabled',
535 'type' => CRM_Utils_Type::T_BOOLEAN,
536 'title' => ts('Confirmation Page?'),
537 'description' => ts('if false, the confirm page in contribution pages gets skipped'),
538 'where' => 'civicrm_contribution_page.is_confirm_enabled',
539 'default' => '1',
540 'table_name' => 'civicrm_contribution_page',
541 'entity' => 'ContributionPage',
542 'bao' => 'CRM_Contribute_BAO_ContributionPage',
543 'localizable' => 0,
544 'add' => '4.2',
545 ],
546 'recur_frequency_unit' => [
547 'name' => 'recur_frequency_unit',
548 'type' => CRM_Utils_Type::T_STRING,
549 'title' => ts('Recurring Frequency'),
550 'description' => ts('Supported recurring frequency units.'),
551 'maxlength' => 128,
552 'size' => CRM_Utils_Type::HUGE,
553 'where' => 'civicrm_contribution_page.recur_frequency_unit',
554 'table_name' => 'civicrm_contribution_page',
555 'entity' => 'ContributionPage',
556 'bao' => 'CRM_Contribute_BAO_ContributionPage',
557 'localizable' => 0,
558 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
559 'html' => [
560 'type' => 'Select',
561 ],
562 'pseudoconstant' => [
563 'optionGroupName' => 'recur_frequency_units',
564 'keyColumn' => 'name',
565 'optionEditPath' => 'civicrm/admin/options/recur_frequency_units',
566 ],
567 'add' => '2.1',
568 ],
569 'is_recur_interval' => [
570 'name' => 'is_recur_interval',
571 'type' => CRM_Utils_Type::T_BOOLEAN,
572 'title' => ts('Support Recurring Intervals'),
573 'description' => ts('if true - supports recurring intervals'),
574 'where' => 'civicrm_contribution_page.is_recur_interval',
575 'default' => '0',
576 'table_name' => 'civicrm_contribution_page',
577 'entity' => 'ContributionPage',
578 'bao' => 'CRM_Contribute_BAO_ContributionPage',
579 'localizable' => 0,
580 'add' => '2.1',
581 ],
582 'is_recur_installments' => [
583 'name' => 'is_recur_installments',
584 'type' => CRM_Utils_Type::T_BOOLEAN,
585 'title' => ts('Recurring Installments?'),
586 'description' => ts('if true - asks user for recurring installments'),
587 'where' => 'civicrm_contribution_page.is_recur_installments',
588 'default' => '0',
589 'table_name' => 'civicrm_contribution_page',
590 'entity' => 'ContributionPage',
591 'bao' => 'CRM_Contribute_BAO_ContributionPage',
592 'localizable' => 0,
593 'add' => '4.3',
594 ],
595 'adjust_recur_start_date' => [
596 'name' => 'adjust_recur_start_date',
597 'type' => CRM_Utils_Type::T_BOOLEAN,
598 'title' => ts('Adjust Recurring Start Date'),
599 'description' => ts('if true - user is able to adjust payment start date'),
600 'where' => 'civicrm_contribution_page.adjust_recur_start_date',
601 'default' => '0',
602 'table_name' => 'civicrm_contribution_page',
603 'entity' => 'ContributionPage',
604 'bao' => 'CRM_Contribute_BAO_ContributionPage',
605 'localizable' => 0,
606 'add' => '4.7',
607 ],
608 'is_pay_later' => [
609 'name' => 'is_pay_later',
610 'type' => CRM_Utils_Type::T_BOOLEAN,
611 'title' => ts('Pay Later'),
612 'description' => ts('if true - allows the user to send payment directly to the org later'),
613 'where' => 'civicrm_contribution_page.is_pay_later',
614 'default' => '0',
615 'table_name' => 'civicrm_contribution_page',
616 'entity' => 'ContributionPage',
617 'bao' => 'CRM_Contribute_BAO_ContributionPage',
618 'localizable' => 0,
619 'add' => '2.0',
620 ],
621 'pay_later_text' => [
622 'name' => 'pay_later_text',
623 'type' => CRM_Utils_Type::T_TEXT,
624 'title' => ts('Pay Later Text'),
625 'description' => ts('The text displayed to the user in the main form'),
626 'where' => 'civicrm_contribution_page.pay_later_text',
627 'table_name' => 'civicrm_contribution_page',
628 'entity' => 'ContributionPage',
629 'bao' => 'CRM_Contribute_BAO_ContributionPage',
630 'localizable' => 1,
631 'add' => '2.0',
632 ],
633 'pay_later_receipt' => [
634 'name' => 'pay_later_receipt',
635 'type' => CRM_Utils_Type::T_TEXT,
636 'title' => ts('Pay Later Receipt'),
637 'description' => ts('The receipt sent to the user instead of the normal receipt text'),
638 'where' => 'civicrm_contribution_page.pay_later_receipt',
639 'table_name' => 'civicrm_contribution_page',
640 'entity' => 'ContributionPage',
641 'bao' => 'CRM_Contribute_BAO_ContributionPage',
642 'localizable' => 1,
643 'add' => '2.0',
644 ],
645 'is_partial_payment' => [
646 'name' => 'is_partial_payment',
647 'type' => CRM_Utils_Type::T_BOOLEAN,
648 'title' => ts('Allow Partial Payment'),
649 'description' => ts('is partial payment enabled for this online contribution page'),
650 'where' => 'civicrm_contribution_page.is_partial_payment',
651 'default' => '0',
652 'table_name' => 'civicrm_contribution_page',
653 'entity' => 'ContributionPage',
654 'bao' => 'CRM_Contribute_BAO_ContributionPage',
655 'localizable' => 0,
656 'add' => '4.3',
657 ],
658 'initial_amount_label' => [
659 'name' => 'initial_amount_label',
660 'type' => CRM_Utils_Type::T_STRING,
661 'title' => ts('Initial Amount Label'),
662 'description' => ts('Initial amount label for partial payment'),
663 'maxlength' => 255,
664 'size' => CRM_Utils_Type::HUGE,
665 'where' => 'civicrm_contribution_page.initial_amount_label',
666 'table_name' => 'civicrm_contribution_page',
667 'entity' => 'ContributionPage',
668 'bao' => 'CRM_Contribute_BAO_ContributionPage',
669 'localizable' => 1,
670 'add' => '4.3',
671 ],
672 'initial_amount_help_text' => [
673 'name' => 'initial_amount_help_text',
674 'type' => CRM_Utils_Type::T_TEXT,
675 'title' => ts('Initial Amount Help Text'),
676 'description' => ts('Initial amount help text for partial payment'),
677 'where' => 'civicrm_contribution_page.initial_amount_help_text',
678 'table_name' => 'civicrm_contribution_page',
679 'entity' => 'ContributionPage',
680 'bao' => 'CRM_Contribute_BAO_ContributionPage',
681 'localizable' => 1,
682 'add' => '4.3',
683 ],
684 'min_initial_amount' => [
685 'name' => 'min_initial_amount',
686 'type' => CRM_Utils_Type::T_MONEY,
687 'title' => ts('Min Initial Amount'),
688 'description' => ts('Minimum initial amount for partial payment'),
689 'precision' => [
690 20,
691 2,
692 ],
693 'where' => 'civicrm_contribution_page.min_initial_amount',
694 'table_name' => 'civicrm_contribution_page',
695 'entity' => 'ContributionPage',
696 'bao' => 'CRM_Contribute_BAO_ContributionPage',
697 'localizable' => 0,
698 'add' => '4.3',
699 ],
700 'is_allow_other_amount' => [
701 'name' => 'is_allow_other_amount',
702 'type' => CRM_Utils_Type::T_BOOLEAN,
703 'title' => ts('Allow Other Amounts'),
704 'description' => ts('if true, page will include an input text field where user can enter their own amount'),
705 'where' => 'civicrm_contribution_page.is_allow_other_amount',
706 'default' => '0',
707 'table_name' => 'civicrm_contribution_page',
708 'entity' => 'ContributionPage',
709 'bao' => 'CRM_Contribute_BAO_ContributionPage',
710 'localizable' => 0,
711 'add' => '1.3',
712 ],
713 'default_amount_id' => [
714 'name' => 'default_amount_id',
715 'type' => CRM_Utils_Type::T_INT,
716 'title' => ts('Default Amount'),
717 'description' => ts('FK to civicrm_option_value.'),
718 'where' => 'civicrm_contribution_page.default_amount_id',
719 'table_name' => 'civicrm_contribution_page',
720 'entity' => 'ContributionPage',
721 'bao' => 'CRM_Contribute_BAO_ContributionPage',
722 'localizable' => 0,
723 'add' => '1.7',
724 ],
725 'min_amount' => [
726 'name' => 'min_amount',
727 'type' => CRM_Utils_Type::T_MONEY,
728 'title' => ts('Minimum Amount'),
729 'description' => ts('if other amounts allowed, user can configure minimum allowed.'),
730 'precision' => [
731 20,
732 2,
733 ],
734 'where' => 'civicrm_contribution_page.min_amount',
735 'table_name' => 'civicrm_contribution_page',
736 'entity' => 'ContributionPage',
737 'bao' => 'CRM_Contribute_BAO_ContributionPage',
738 'localizable' => 0,
739 'add' => '1.3',
740 ],
741 'max_amount' => [
742 'name' => 'max_amount',
743 'type' => CRM_Utils_Type::T_MONEY,
744 'title' => ts('Maximum Amount'),
745 'description' => ts('if other amounts allowed, user can configure maximum allowed.'),
746 'precision' => [
747 20,
748 2,
749 ],
750 'where' => 'civicrm_contribution_page.max_amount',
751 'table_name' => 'civicrm_contribution_page',
752 'entity' => 'ContributionPage',
753 'bao' => 'CRM_Contribute_BAO_ContributionPage',
754 'localizable' => 0,
755 'add' => '1.3',
756 ],
757 'goal_amount' => [
758 'name' => 'goal_amount',
759 'type' => CRM_Utils_Type::T_MONEY,
760 'title' => ts('Goal Amount'),
761 'description' => ts('The target goal for this page, allows people to build a goal meter'),
762 'precision' => [
763 20,
764 2,
765 ],
766 'where' => 'civicrm_contribution_page.goal_amount',
767 'table_name' => 'civicrm_contribution_page',
768 'entity' => 'ContributionPage',
769 'bao' => 'CRM_Contribute_BAO_ContributionPage',
770 'localizable' => 0,
771 'add' => '1.5',
772 ],
773 'thankyou_title' => [
774 'name' => 'thankyou_title',
775 'type' => CRM_Utils_Type::T_STRING,
776 'title' => ts('Thank-you Title'),
777 'description' => ts('Title for Thank-you page (header title tag, and display at the top of the page).'),
778 'maxlength' => 255,
779 'size' => CRM_Utils_Type::HUGE,
780 'where' => 'civicrm_contribution_page.thankyou_title',
781 'table_name' => 'civicrm_contribution_page',
782 'entity' => 'ContributionPage',
783 'bao' => 'CRM_Contribute_BAO_ContributionPage',
784 'localizable' => 1,
785 'add' => '1.3',
786 ],
787 'thankyou_text' => [
788 'name' => 'thankyou_text',
789 'type' => CRM_Utils_Type::T_TEXT,
790 'title' => ts('Thank-you Text'),
791 'description' => ts('text and html allowed. displayed above result on success page'),
792 'rows' => 8,
793 'cols' => 60,
794 'where' => 'civicrm_contribution_page.thankyou_text',
795 'table_name' => 'civicrm_contribution_page',
796 'entity' => 'ContributionPage',
797 'bao' => 'CRM_Contribute_BAO_ContributionPage',
798 'localizable' => 1,
799 'html' => [
800 'type' => 'RichTextEditor',
801 ],
802 'add' => '1.3',
803 ],
804 'thankyou_footer' => [
805 'name' => 'thankyou_footer',
806 'type' => CRM_Utils_Type::T_TEXT,
807 'title' => ts('Thank-you Footer'),
808 '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.'),
809 'rows' => 8,
810 'cols' => 60,
811 'where' => 'civicrm_contribution_page.thankyou_footer',
812 'table_name' => 'civicrm_contribution_page',
813 'entity' => 'ContributionPage',
814 'bao' => 'CRM_Contribute_BAO_ContributionPage',
815 'localizable' => 1,
816 'html' => [
817 'type' => 'RichTextEditor',
818 ],
819 'add' => '1.3',
820 ],
821 'is_email_receipt' => [
822 'name' => 'is_email_receipt',
823 'type' => CRM_Utils_Type::T_BOOLEAN,
824 'title' => ts('Send email Receipt'),
825 'description' => ts('if true, receipt is automatically emailed to contact on success'),
826 'where' => 'civicrm_contribution_page.is_email_receipt',
827 'default' => '0',
828 'table_name' => 'civicrm_contribution_page',
829 'entity' => 'ContributionPage',
830 'bao' => 'CRM_Contribute_BAO_ContributionPage',
831 'localizable' => 0,
832 'add' => '1.3',
833 ],
834 'receipt_from_name' => [
835 'name' => 'receipt_from_name',
836 'type' => CRM_Utils_Type::T_STRING,
837 'title' => ts('Receipt From'),
838 'description' => ts('FROM email name used for receipts generated by contributions to this contribution page.'),
839 'maxlength' => 255,
840 'size' => CRM_Utils_Type::HUGE,
841 'where' => 'civicrm_contribution_page.receipt_from_name',
842 'table_name' => 'civicrm_contribution_page',
843 'entity' => 'ContributionPage',
844 'bao' => 'CRM_Contribute_BAO_ContributionPage',
845 'localizable' => 1,
846 'add' => '1.3',
847 ],
848 'receipt_from_email' => [
849 'name' => 'receipt_from_email',
850 'type' => CRM_Utils_Type::T_STRING,
851 'title' => ts('Receipt From email'),
852 'description' => ts('FROM email address used for receipts generated by contributions to this contribution page.'),
853 'maxlength' => 255,
854 'size' => CRM_Utils_Type::HUGE,
855 'where' => 'civicrm_contribution_page.receipt_from_email',
856 'table_name' => 'civicrm_contribution_page',
857 'entity' => 'ContributionPage',
858 'bao' => 'CRM_Contribute_BAO_ContributionPage',
859 'localizable' => 0,
860 'add' => '1.3',
861 ],
862 'cc_receipt' => [
863 'name' => 'cc_receipt',
864 'type' => CRM_Utils_Type::T_STRING,
865 'title' => ts('Receipt cc'),
866 'description' => ts('comma-separated list of email addresses to cc each time a receipt is sent'),
867 'maxlength' => 255,
868 'size' => CRM_Utils_Type::HUGE,
869 'where' => 'civicrm_contribution_page.cc_receipt',
870 'table_name' => 'civicrm_contribution_page',
871 'entity' => 'ContributionPage',
872 'bao' => 'CRM_Contribute_BAO_ContributionPage',
873 'localizable' => 0,
874 'add' => '1.3',
875 ],
876 'bcc_receipt' => [
877 'name' => 'bcc_receipt',
878 'type' => CRM_Utils_Type::T_STRING,
879 'title' => ts('Receipt bcc'),
880 'description' => ts('comma-separated list of email addresses to bcc each time a receipt is sent'),
881 'maxlength' => 255,
882 'size' => CRM_Utils_Type::HUGE,
883 'where' => 'civicrm_contribution_page.bcc_receipt',
884 'table_name' => 'civicrm_contribution_page',
885 'entity' => 'ContributionPage',
886 'bao' => 'CRM_Contribute_BAO_ContributionPage',
887 'localizable' => 0,
888 'add' => '1.3',
889 ],
890 'receipt_text' => [
891 'name' => 'receipt_text',
892 'type' => CRM_Utils_Type::T_TEXT,
893 'title' => ts('Receipt Text'),
894 'description' => ts('text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now'),
895 'rows' => 6,
896 'cols' => 50,
897 'where' => 'civicrm_contribution_page.receipt_text',
898 'table_name' => 'civicrm_contribution_page',
899 'entity' => 'ContributionPage',
900 'bao' => 'CRM_Contribute_BAO_ContributionPage',
901 'localizable' => 1,
902 'html' => [
903 'type' => 'TextArea',
904 ],
905 'add' => '1.3',
906 ],
907 'is_active' => [
908 'name' => 'is_active',
909 'type' => CRM_Utils_Type::T_BOOLEAN,
910 'title' => ts('Is Page Active?'),
911 'description' => ts('Is this property active?'),
912 'where' => 'civicrm_contribution_page.is_active',
913 'table_name' => 'civicrm_contribution_page',
914 'entity' => 'ContributionPage',
915 'bao' => 'CRM_Contribute_BAO_ContributionPage',
916 'localizable' => 0,
917 'add' => '1.3',
918 ],
919 'footer_text' => [
920 'name' => 'footer_text',
921 'type' => CRM_Utils_Type::T_TEXT,
922 'title' => ts('Footer Text'),
923 'description' => ts('Text and html allowed. Displayed at the bottom of the first page of the contribution wizard.'),
924 'rows' => 6,
925 'cols' => 50,
926 'where' => 'civicrm_contribution_page.footer_text',
927 'table_name' => 'civicrm_contribution_page',
928 'entity' => 'ContributionPage',
929 'bao' => 'CRM_Contribute_BAO_ContributionPage',
930 'localizable' => 1,
931 'html' => [
932 'type' => 'RichTextEditor',
933 ],
934 'add' => '1.4',
935 ],
936 'amount_block_is_active' => [
937 'name' => 'amount_block_is_active',
938 'type' => CRM_Utils_Type::T_BOOLEAN,
939 'title' => ts('Is Amount Block Active?'),
940 'description' => ts('Is this property active?'),
941 'where' => 'civicrm_contribution_page.amount_block_is_active',
942 'default' => '1',
943 'table_name' => 'civicrm_contribution_page',
944 'entity' => 'ContributionPage',
945 'bao' => 'CRM_Contribute_BAO_ContributionPage',
946 'localizable' => 0,
947 'add' => '1.5',
948 ],
949 'start_date' => [
950 'name' => 'start_date',
951 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
952 'title' => ts('Contribution Page Start Date'),
953 'description' => ts('Date and time that this page starts.'),
954 'where' => 'civicrm_contribution_page.start_date',
955 'table_name' => 'civicrm_contribution_page',
956 'entity' => 'ContributionPage',
957 'bao' => 'CRM_Contribute_BAO_ContributionPage',
958 'localizable' => 0,
959 'add' => '1.8',
960 ],
961 'end_date' => [
962 'name' => 'end_date',
963 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
964 'title' => ts('Contribution Page End Date'),
965 'description' => ts('Date and time that this page ends. May be NULL if no defined end date/time'),
966 'where' => 'civicrm_contribution_page.end_date',
967 'table_name' => 'civicrm_contribution_page',
968 'entity' => 'ContributionPage',
969 'bao' => 'CRM_Contribute_BAO_ContributionPage',
970 'localizable' => 0,
971 'add' => '1.8',
972 ],
973 'created_id' => [
974 'name' => 'created_id',
975 'type' => CRM_Utils_Type::T_INT,
976 'title' => ts('Contribution Page Created By'),
977 'description' => ts('FK to civicrm_contact, who created this contribution page'),
978 'where' => 'civicrm_contribution_page.created_id',
979 'table_name' => 'civicrm_contribution_page',
980 'entity' => 'ContributionPage',
981 'bao' => 'CRM_Contribute_BAO_ContributionPage',
982 'localizable' => 0,
983 'FKClassName' => 'CRM_Contact_DAO_Contact',
984 'add' => '3.0',
985 ],
986 'created_date' => [
987 'name' => 'created_date',
988 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
989 'title' => ts('Contribution Page Created Date'),
990 'description' => ts('Date and time that contribution page was created.'),
991 'where' => 'civicrm_contribution_page.created_date',
992 'table_name' => 'civicrm_contribution_page',
993 'entity' => 'ContributionPage',
994 'bao' => 'CRM_Contribute_BAO_ContributionPage',
995 'localizable' => 0,
996 'add' => '3.0',
997 ],
998 'currency' => [
999 'name' => 'currency',
1000 'type' => CRM_Utils_Type::T_STRING,
1001 'title' => ts('Contribution Page Currency'),
1002 'description' => ts('3 character string, value from config setting or input via user.'),
1003 'maxlength' => 3,
1004 'size' => CRM_Utils_Type::FOUR,
1005 'where' => 'civicrm_contribution_page.currency',
1006 'headerPattern' => '/cur(rency)?/i',
1007 'dataPattern' => '/^[A-Z]{3}$/i',
1008 'default' => 'NULL',
1009 'table_name' => 'civicrm_contribution_page',
1010 'entity' => 'ContributionPage',
1011 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1012 'localizable' => 0,
1013 'html' => [
1014 'type' => 'Select',
1015 ],
1016 'pseudoconstant' => [
1017 'table' => 'civicrm_currency',
1018 'keyColumn' => 'name',
1019 'labelColumn' => 'full_name',
1020 'nameColumn' => 'name',
1021 'abbrColumn' => 'symbol',
1022 ],
1023 'add' => '3.3',
1024 ],
1025 'campaign_id' => [
1026 'name' => 'campaign_id',
1027 'type' => CRM_Utils_Type::T_INT,
1028 'title' => ts('Contribution Page Campaign ID'),
1029 'description' => ts('The campaign for which we are collecting contributions with this page.'),
1030 'where' => 'civicrm_contribution_page.campaign_id',
1031 'table_name' => 'civicrm_contribution_page',
1032 'entity' => 'ContributionPage',
1033 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1034 'localizable' => 0,
1035 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
1036 'add' => '3.4',
1037 ],
1038 'is_share' => [
1039 'name' => 'is_share',
1040 'type' => CRM_Utils_Type::T_BOOLEAN,
1041 'title' => ts('Is Contribution Page Shared?'),
1042 'description' => ts('Can people share the contribution page through social media?'),
1043 'where' => 'civicrm_contribution_page.is_share',
1044 'default' => '1',
1045 'table_name' => 'civicrm_contribution_page',
1046 'entity' => 'ContributionPage',
1047 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1048 'localizable' => 0,
1049 'add' => '4.1',
1050 ],
1051 'is_billing_required' => [
1052 'name' => 'is_billing_required',
1053 'type' => CRM_Utils_Type::T_BOOLEAN,
1054 'title' => ts('Is billing block required'),
1055 'description' => ts('if true - billing block is required for online contribution page'),
1056 'where' => 'civicrm_contribution_page.is_billing_required',
1057 'default' => '0',
1058 'table_name' => 'civicrm_contribution_page',
1059 'entity' => 'ContributionPage',
1060 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1061 'localizable' => 0,
1062 'add' => '4.6',
1063 ],
1064 'contribution_page_frontend_title' => [
1065 'name' => 'frontend_title',
1066 'type' => CRM_Utils_Type::T_STRING,
1067 'title' => ts('Public Title'),
1068 'description' => ts('Contribution Page Public title'),
1069 'maxlength' => 255,
1070 'size' => CRM_Utils_Type::HUGE,
1071 'where' => 'civicrm_contribution_page.frontend_title',
1072 'default' => 'NULL',
1073 'table_name' => 'civicrm_contribution_page',
1074 'entity' => 'ContributionPage',
1075 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1076 'localizable' => 1,
1077 'html' => [
1078 'type' => 'Text',
1079 ],
1080 'add' => '5.20',
1081 ],
1082 ];
1083 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
1084 }
1085 return Civi::$statics[__CLASS__]['fields'];
1086 }
1087
1088 /**
1089 * Return a mapping from field-name to the corresponding key (as used in fields()).
1090 *
1091 * @return array
1092 * Array(string $name => string $uniqueName).
1093 */
1094 public static function &fieldKeys() {
1095 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
1096 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
1097 }
1098 return Civi::$statics[__CLASS__]['fieldKeys'];
1099 }
1100
1101 /**
1102 * Returns the names of this table
1103 *
1104 * @return string
1105 */
1106 public static function getTableName() {
1107 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
1108 }
1109
1110 /**
1111 * Returns if this table needs to be logged
1112 *
1113 * @return bool
1114 */
1115 public function getLog() {
1116 return self::$_log;
1117 }
1118
1119 /**
1120 * Returns the list of fields that can be imported
1121 *
1122 * @param bool $prefix
1123 *
1124 * @return array
1125 */
1126 public static function &import($prefix = FALSE) {
1127 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution_page', $prefix, []);
1128 return $r;
1129 }
1130
1131 /**
1132 * Returns the list of fields that can be exported
1133 *
1134 * @param bool $prefix
1135 *
1136 * @return array
1137 */
1138 public static function &export($prefix = FALSE) {
1139 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution_page', $prefix, []);
1140 return $r;
1141 }
1142
1143 /**
1144 * Returns the list of indices
1145 *
1146 * @param bool $localize
1147 *
1148 * @return array
1149 */
1150 public static function indices($localize = TRUE) {
1151 $indices = [];
1152 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
1153 }
1154
1155 }