3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2016
31 * Generated from xml/schema/CRM/Contribute/ContributionPage.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:5ee386ebb241a924256941b964427a29)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Contribute_DAO_ContributionPage
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_contribution_page';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
90 * Contribution Page title. For top of page display
96 * Text and html allowed. Displayed below title.
102 * default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution
106 public $financial_type_id;
108 * Payment Processors configured for this contribution Page
112 public $payment_processor;
114 * if true - processing logic must reject transaction at confirmation stage if pay method != credit card
118 public $is_credit_card_only;
120 * if true - allows real-time monetary transactions otherwise non-monetary transactions
126 * if true - allows recurring contributions, valid only for PayPal_Standard
132 * if false, the confirm page in contribution pages gets skipped
136 public $is_confirm_enabled;
138 * Supported recurring frequency units.
142 public $recur_frequency_unit;
144 * if true - supports recurring intervals
148 public $is_recur_interval;
150 * if true - asks user for recurring installments
154 public $is_recur_installments;
156 * if true - user is able to adjust payment start date
160 public $adjust_recur_start_date;
162 * if true - allows the user to send payment directly to the org later
166 public $is_pay_later;
168 * The text displayed to the user in the main form
172 public $pay_later_text;
174 * The receipt sent to the user instead of the normal receipt text
178 public $pay_later_receipt;
180 * is partial payment enabled for this online contribution page
184 public $is_partial_payment;
186 * Initial amount label for partial payment
190 public $initial_amount_label;
192 * Initial amount help text for partial payment
196 public $initial_amount_help_text;
198 * Minimum initial amount for partial payment
202 public $min_initial_amount;
204 * if true, page will include an input text field where user can enter their own amount
208 public $is_allow_other_amount;
210 * FK to civicrm_option_value.
214 public $default_amount_id;
216 * if other amounts allowed, user can configure minimum allowed.
222 * if other amounts allowed, user can configure maximum allowed.
228 * The target goal for this page, allows people to build a goal meter
234 * Title for Thank-you page (header title tag, and display at the top of the page).
238 public $thankyou_title;
240 * text and html allowed. displayed above result on success page
244 public $thankyou_text;
246 * 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.
250 public $thankyou_footer;
252 * if true, receipt is automatically emailed to contact on success
256 public $is_email_receipt;
258 * FROM email name used for receipts generated by contributions to this contribution page.
262 public $receipt_from_name;
264 * FROM email address used for receipts generated by contributions to this contribution page.
268 public $receipt_from_email;
270 * comma-separated list of email addresses to cc each time a receipt is sent
276 * comma-separated list of email addresses to bcc each time a receipt is sent
282 * text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now
286 public $receipt_text;
288 * Is this property active?
294 * Text and html allowed. Displayed at the bottom of the first page of the contribution wizard.
300 * Is this property active?
304 public $amount_block_is_active;
306 * Date and time that this page starts.
312 * Date and time that this page ends. May be NULL if no defined end date/time
318 * FK to civicrm_contact, who created this contribution page
324 * Date and time that contribution page was created.
328 public $created_date;
330 * 3 character string, value from config setting or input via user.
336 * The campaign for which we are collecting contributions with this page.
342 * Can people share the contribution page through social media?
348 * if true - billing block is required for online contribution page
352 public $is_billing_required;
356 * @return civicrm_contribution_page
358 function __construct() {
359 $this->__table
= 'civicrm_contribution_page';
360 parent
::__construct();
363 * Returns foreign keys and entity references
366 * [CRM_Core_Reference_Interface]
368 static function getReferenceColumns() {
369 if (!self
::$_links) {
370 self
::$_links = static ::createReferenceColumns(__CLASS__
);
371 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
372 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
373 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'campaign_id', 'civicrm_campaign', 'id');
375 return self
::$_links;
378 * Returns all the column names of this table
382 static function &fields() {
383 if (!(self
::$_fields)) {
384 self
::$_fields = array(
387 'type' => CRM_Utils_Type
::T_INT
,
388 'title' => ts('Contribution Page ID') ,
389 'description' => 'Contribution Id',
394 'type' => CRM_Utils_Type
::T_STRING
,
395 'title' => ts('Contribution Page Title') ,
396 'description' => 'Contribution Page title. For top of page display',
398 'size' => CRM_Utils_Type
::HUGE
,
400 'intro_text' => array(
401 'name' => 'intro_text',
402 'type' => CRM_Utils_Type
::T_TEXT
,
403 'title' => ts('Contribution Page Introduction Text') ,
404 'description' => 'Text and html allowed. Displayed below title.',
408 'type' => 'RichTextEditor',
411 'financial_type_id' => array(
412 'name' => 'financial_type_id',
413 'type' => CRM_Utils_Type
::T_INT
,
414 'title' => ts('Financial Type') ,
415 'description' => 'default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution',
416 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
420 'pseudoconstant' => array(
421 'table' => 'civicrm_financial_type',
423 'labelColumn' => 'name',
426 'payment_processor' => array(
427 'name' => 'payment_processor',
428 'type' => CRM_Utils_Type
::T_STRING
,
429 'title' => ts('Payment Processor') ,
430 'description' => 'Payment Processors configured for this contribution Page',
432 'size' => CRM_Utils_Type
::HUGE
,
436 'pseudoconstant' => array(
437 'table' => 'civicrm_payment_processor',
439 'labelColumn' => 'name',
442 'is_credit_card_only' => array(
443 'name' => 'is_credit_card_only',
444 'type' => CRM_Utils_Type
::T_BOOLEAN
,
445 'title' => ts('Is Credit Card Only?') ,
446 'description' => 'if true - processing logic must reject transaction at confirmation stage if pay method != credit card',
448 'is_monetary' => array(
449 'name' => 'is_monetary',
450 'type' => CRM_Utils_Type
::T_BOOLEAN
,
451 'title' => ts('Is Monetary') ,
452 'description' => 'if true - allows real-time monetary transactions otherwise non-monetary transactions',
456 'name' => 'is_recur',
457 'type' => CRM_Utils_Type
::T_BOOLEAN
,
458 'title' => ts('Is Recurring') ,
459 'description' => 'if true - allows recurring contributions, valid only for PayPal_Standard',
461 'is_confirm_enabled' => array(
462 'name' => 'is_confirm_enabled',
463 'type' => CRM_Utils_Type
::T_BOOLEAN
,
464 'title' => ts('Confirmation Page?') ,
465 'description' => 'if false, the confirm page in contribution pages gets skipped',
468 'recur_frequency_unit' => array(
469 'name' => 'recur_frequency_unit',
470 'type' => CRM_Utils_Type
::T_STRING
,
471 'title' => ts('Recurring Frequency') ,
472 'description' => 'Supported recurring frequency units.',
474 'size' => CRM_Utils_Type
::HUGE
,
476 'is_recur_interval' => array(
477 'name' => 'is_recur_interval',
478 'type' => CRM_Utils_Type
::T_BOOLEAN
,
479 'title' => ts('Support Recurring Intervals') ,
480 'description' => 'if true - supports recurring intervals',
482 'is_recur_installments' => array(
483 'name' => 'is_recur_installments',
484 'type' => CRM_Utils_Type
::T_BOOLEAN
,
485 'title' => ts('Recurring Installments?') ,
486 'description' => 'if true - asks user for recurring installments',
488 'adjust_recur_start_date' => array(
489 'name' => 'adjust_recur_start_date',
490 'type' => CRM_Utils_Type
::T_BOOLEAN
,
491 'title' => ts('Adjust Recurring Start Date') ,
492 'description' => 'if true - user is able to adjust payment start date',
494 'is_pay_later' => array(
495 'name' => 'is_pay_later',
496 'type' => CRM_Utils_Type
::T_BOOLEAN
,
497 'title' => ts('Pay Later') ,
498 'description' => 'if true - allows the user to send payment directly to the org later',
500 'pay_later_text' => array(
501 'name' => 'pay_later_text',
502 'type' => CRM_Utils_Type
::T_TEXT
,
503 'title' => ts('Pay Later Text') ,
504 'description' => 'The text displayed to the user in the main form',
506 'pay_later_receipt' => array(
507 'name' => 'pay_later_receipt',
508 'type' => CRM_Utils_Type
::T_TEXT
,
509 'title' => ts('Pay Later Receipt') ,
510 'description' => 'The receipt sent to the user instead of the normal receipt text',
512 'is_partial_payment' => array(
513 'name' => 'is_partial_payment',
514 'type' => CRM_Utils_Type
::T_BOOLEAN
,
515 'title' => ts('Allow Partial Payment') ,
516 'description' => 'is partial payment enabled for this online contribution page',
518 'initial_amount_label' => array(
519 'name' => 'initial_amount_label',
520 'type' => CRM_Utils_Type
::T_STRING
,
521 'title' => ts('Initial Amount Label') ,
522 'description' => 'Initial amount label for partial payment',
524 'size' => CRM_Utils_Type
::HUGE
,
526 'initial_amount_help_text' => array(
527 'name' => 'initial_amount_help_text',
528 'type' => CRM_Utils_Type
::T_TEXT
,
529 'title' => ts('Initial Amount Help Text') ,
530 'description' => 'Initial amount help text for partial payment',
532 'min_initial_amount' => array(
533 'name' => 'min_initial_amount',
534 'type' => CRM_Utils_Type
::T_MONEY
,
535 'title' => ts('Min Initial Amount') ,
536 'description' => 'Minimum initial amount for partial payment',
537 'precision' => array(
542 'is_allow_other_amount' => array(
543 'name' => 'is_allow_other_amount',
544 'type' => CRM_Utils_Type
::T_BOOLEAN
,
545 'title' => ts('Allow Other Amounts') ,
546 'description' => 'if true, page will include an input text field where user can enter their own amount',
548 'default_amount_id' => array(
549 'name' => 'default_amount_id',
550 'type' => CRM_Utils_Type
::T_INT
,
551 'title' => ts('Default Amount') ,
552 'description' => 'FK to civicrm_option_value.',
554 'min_amount' => array(
555 'name' => 'min_amount',
556 'type' => CRM_Utils_Type
::T_MONEY
,
557 'title' => ts('Minimum Amount') ,
558 'description' => 'if other amounts allowed, user can configure minimum allowed.',
559 'precision' => array(
564 'max_amount' => array(
565 'name' => 'max_amount',
566 'type' => CRM_Utils_Type
::T_MONEY
,
567 'title' => ts('Maximum Amount') ,
568 'description' => 'if other amounts allowed, user can configure maximum allowed.',
569 'precision' => array(
574 'goal_amount' => array(
575 'name' => 'goal_amount',
576 'type' => CRM_Utils_Type
::T_MONEY
,
577 'title' => ts('Goal Amount') ,
578 'description' => 'The target goal for this page, allows people to build a goal meter',
579 'precision' => array(
584 'thankyou_title' => array(
585 'name' => 'thankyou_title',
586 'type' => CRM_Utils_Type
::T_STRING
,
587 'title' => ts('Thank-you Title') ,
588 'description' => 'Title for Thank-you page (header title tag, and display at the top of the page).',
590 'size' => CRM_Utils_Type
::HUGE
,
592 'thankyou_text' => array(
593 'name' => 'thankyou_text',
594 'type' => CRM_Utils_Type
::T_TEXT
,
595 'title' => ts('Thank-you Text') ,
596 'description' => 'text and html allowed. displayed above result on success page',
600 'type' => 'RichTextEditor',
603 'thankyou_footer' => array(
604 'name' => 'thankyou_footer',
605 'type' => CRM_Utils_Type
::T_TEXT
,
606 'title' => ts('Thank-you Footer') ,
607 'description' => 'Text and html allowed. displayed at the bottom of the success page. Common usage is to include link(s) to other pages such as tell-a-friend, etc.',
611 'type' => 'RichTextEditor',
614 'is_email_receipt' => array(
615 'name' => 'is_email_receipt',
616 'type' => CRM_Utils_Type
::T_BOOLEAN
,
617 'title' => ts('Send email Receipt') ,
618 'description' => 'if true, receipt is automatically emailed to contact on success',
620 'receipt_from_name' => array(
621 'name' => 'receipt_from_name',
622 'type' => CRM_Utils_Type
::T_STRING
,
623 'title' => ts('Receipt From') ,
624 'description' => 'FROM email name used for receipts generated by contributions to this contribution page.',
626 'size' => CRM_Utils_Type
::HUGE
,
628 'receipt_from_email' => array(
629 'name' => 'receipt_from_email',
630 'type' => CRM_Utils_Type
::T_STRING
,
631 'title' => ts('Receipt From email') ,
632 'description' => 'FROM email address used for receipts generated by contributions to this contribution page.',
634 'size' => CRM_Utils_Type
::HUGE
,
636 'cc_receipt' => array(
637 'name' => 'cc_receipt',
638 'type' => CRM_Utils_Type
::T_STRING
,
639 'title' => ts('Receipt cc') ,
640 'description' => 'comma-separated list of email addresses to cc each time a receipt is sent',
642 'size' => CRM_Utils_Type
::HUGE
,
644 'bcc_receipt' => array(
645 'name' => 'bcc_receipt',
646 'type' => CRM_Utils_Type
::T_STRING
,
647 'title' => ts('Receipt bcc') ,
648 'description' => 'comma-separated list of email addresses to bcc each time a receipt is sent',
650 'size' => CRM_Utils_Type
::HUGE
,
652 'receipt_text' => array(
653 'name' => 'receipt_text',
654 'type' => CRM_Utils_Type
::T_TEXT
,
655 'title' => ts('Receipt Text') ,
656 'description' => 'text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now',
660 'type' => 'TextArea',
663 'is_active' => array(
664 'name' => 'is_active',
665 'type' => CRM_Utils_Type
::T_BOOLEAN
,
666 'title' => ts('Is Page Active?') ,
667 'description' => 'Is this property active?',
669 'footer_text' => array(
670 'name' => 'footer_text',
671 'type' => CRM_Utils_Type
::T_TEXT
,
672 'title' => ts('Footer Text') ,
673 'description' => 'Text and html allowed. Displayed at the bottom of the first page of the contribution wizard.',
677 'type' => 'RichTextEditor',
680 'amount_block_is_active' => array(
681 'name' => 'amount_block_is_active',
682 'type' => CRM_Utils_Type
::T_BOOLEAN
,
683 'title' => ts('Is Amount Block Active?') ,
684 'description' => 'Is this property active?',
687 'start_date' => array(
688 'name' => 'start_date',
689 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
690 'title' => ts('Contribution Page Start Date') ,
691 'description' => 'Date and time that this page starts.',
694 'name' => 'end_date',
695 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
696 'title' => ts('Contribution Page End Date') ,
697 'description' => 'Date and time that this page ends. May be NULL if no defined end date/time',
699 'created_id' => array(
700 'name' => 'created_id',
701 'type' => CRM_Utils_Type
::T_INT
,
702 'title' => ts('Contribution Page Created By') ,
703 'description' => 'FK to civicrm_contact, who created this contribution page',
704 'FKClassName' => 'CRM_Contact_DAO_Contact',
706 'created_date' => array(
707 'name' => 'created_date',
708 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
709 'title' => ts('Contribution Page Created Date') ,
710 'description' => 'Date and time that contribution page was created.',
713 'name' => 'currency',
714 'type' => CRM_Utils_Type
::T_STRING
,
715 'title' => ts('Contribution Page Currency') ,
716 'description' => '3 character string, value from config setting or input via user.',
718 'size' => CRM_Utils_Type
::FOUR
,
723 'pseudoconstant' => array(
724 'table' => 'civicrm_currency',
725 'keyColumn' => 'name',
726 'labelColumn' => 'full_name',
727 'nameColumn' => 'name',
730 'campaign_id' => array(
731 'name' => 'campaign_id',
732 'type' => CRM_Utils_Type
::T_INT
,
733 'title' => ts('Contribution Page Campaign ID') ,
734 'description' => 'The campaign for which we are collecting contributions with this page.',
735 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
736 'pseudoconstant' => array(
737 'table' => 'civicrm_campaign',
739 'labelColumn' => 'title',
743 'name' => 'is_share',
744 'type' => CRM_Utils_Type
::T_BOOLEAN
,
745 'title' => ts('Is Contribution Page Shared?') ,
746 'description' => 'Can people share the contribution page through social media?',
749 'is_billing_required' => array(
750 'name' => 'is_billing_required',
751 'type' => CRM_Utils_Type
::T_BOOLEAN
,
752 'title' => ts('Is billing block required') ,
753 'description' => 'if true - billing block is required for online contribution page',
757 return self
::$_fields;
760 * Returns an array containing, for each field, the arary key used for that
761 * field in self::$_fields.
765 static function &fieldKeys() {
766 if (!(self
::$_fieldKeys)) {
767 self
::$_fieldKeys = array(
770 'intro_text' => 'intro_text',
771 'financial_type_id' => 'financial_type_id',
772 'payment_processor' => 'payment_processor',
773 'is_credit_card_only' => 'is_credit_card_only',
774 'is_monetary' => 'is_monetary',
775 'is_recur' => 'is_recur',
776 'is_confirm_enabled' => 'is_confirm_enabled',
777 'recur_frequency_unit' => 'recur_frequency_unit',
778 'is_recur_interval' => 'is_recur_interval',
779 'is_recur_installments' => 'is_recur_installments',
780 'adjust_recur_start_date' => 'adjust_recur_start_date',
781 'is_pay_later' => 'is_pay_later',
782 'pay_later_text' => 'pay_later_text',
783 'pay_later_receipt' => 'pay_later_receipt',
784 'is_partial_payment' => 'is_partial_payment',
785 'initial_amount_label' => 'initial_amount_label',
786 'initial_amount_help_text' => 'initial_amount_help_text',
787 'min_initial_amount' => 'min_initial_amount',
788 'is_allow_other_amount' => 'is_allow_other_amount',
789 'default_amount_id' => 'default_amount_id',
790 'min_amount' => 'min_amount',
791 'max_amount' => 'max_amount',
792 'goal_amount' => 'goal_amount',
793 'thankyou_title' => 'thankyou_title',
794 'thankyou_text' => 'thankyou_text',
795 'thankyou_footer' => 'thankyou_footer',
796 'is_email_receipt' => 'is_email_receipt',
797 'receipt_from_name' => 'receipt_from_name',
798 'receipt_from_email' => 'receipt_from_email',
799 'cc_receipt' => 'cc_receipt',
800 'bcc_receipt' => 'bcc_receipt',
801 'receipt_text' => 'receipt_text',
802 'is_active' => 'is_active',
803 'footer_text' => 'footer_text',
804 'amount_block_is_active' => 'amount_block_is_active',
805 'start_date' => 'start_date',
806 'end_date' => 'end_date',
807 'created_id' => 'created_id',
808 'created_date' => 'created_date',
809 'currency' => 'currency',
810 'campaign_id' => 'campaign_id',
811 'is_share' => 'is_share',
812 'is_billing_required' => 'is_billing_required',
815 return self
::$_fieldKeys;
818 * Returns the names of this table
822 static function getTableName() {
823 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
826 * Returns if this table needs to be logged
834 * Returns the list of fields that can be imported
836 * @param bool $prefix
840 static function &import($prefix = false) {
841 if (!(self
::$_import)) {
842 self
::$_import = array();
843 $fields = self
::fields();
844 foreach($fields as $name => $field) {
845 if (CRM_Utils_Array
::value('import', $field)) {
847 self
::$_import['contribution_page'] = & $fields[$name];
849 self
::$_import[$name] = & $fields[$name];
854 return self
::$_import;
857 * Returns the list of fields that can be exported
859 * @param bool $prefix
863 static function &export($prefix = false) {
864 if (!(self
::$_export)) {
865 self
::$_export = array();
866 $fields = self
::fields();
867 foreach($fields as $name => $field) {
868 if (CRM_Utils_Array
::value('export', $field)) {
870 self
::$_export['contribution_page'] = & $fields[$name];
872 self
::$_export[$name] = & $fields[$name];
877 return self
::$_export;