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