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