3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
31 * Generated from xml/schema/CRM/Contribute/ContributionPage.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Contribute_DAO_ContributionPage
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_contribution_page';
44 * static instance to hold the field values
48 static $_fields = null;
50 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = null;
56 * static instance to hold the FK relationships
60 static $_links = null;
62 * static instance to hold the values that can
67 static $_import = null;
69 * static instance to hold the values that can
74 static $_export = null;
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
89 * Contribution Page title. For top of page display
95 * Text and html allowed. Displayed below title.
101 * default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution
105 public $financial_type_id;
107 * Payment Processors configured for this contribution Page
111 public $payment_processor;
113 * if true - processing logic must reject transaction at confirmation stage if pay method != credit card
117 public $is_credit_card_only;
119 * if true - allows real-time monetary transactions otherwise non-monetary transactions
125 * if true - allows recurring contributions, valid only for PayPal_Standard
131 * if false, the confirm page in contribution pages gets skipped
135 public $is_confirm_enabled;
137 * Supported recurring frequency units.
141 public $recur_frequency_unit;
143 * if true - supports recurring intervals
147 public $is_recur_interval;
149 * if true - asks user for recurring installments
153 public $is_recur_installments;
155 * if true - allows the user to send payment directly to the org later
159 public $is_pay_later;
161 * The text displayed to the user in the main form
165 public $pay_later_text;
167 * The receipt sent to the user instead of the normal receipt text
171 public $pay_later_receipt;
173 * is partial payment enabled for this online contribution page
177 public $is_partial_payment;
179 * Initial amount label for partial payment
183 public $initial_amount_label;
185 * Initial amount help text for partial payment
189 public $initial_amount_help_text;
191 * Minimum initial amount for partial payment
195 public $min_initial_amount;
197 * if true, page will include an input text field where user can enter their own amount
201 public $is_allow_other_amount;
203 * FK to civicrm_option_value.
207 public $default_amount_id;
209 * if other amounts allowed, user can configure minimum allowed.
215 * if other amounts allowed, user can configure maximum allowed.
221 * The target goal for this page, allows people to build a goal meter
227 * Title for Thank-you page (header title tag, and display at the top of the page).
231 public $thankyou_title;
233 * text and html allowed. displayed above result on success page
237 public $thankyou_text;
239 * 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.
243 public $thankyou_footer;
245 * if true, signup is done on behalf of an organization
249 public $is_for_organization;
251 * This text field is shown when is_for_organization is checked. For example - I am contributing on behalf on an organization.
255 public $for_organization;
257 * if true, receipt is automatically emailed to contact on success
261 public $is_email_receipt;
263 * FROM email name used for receipts generated by contributions to this contribution page.
267 public $receipt_from_name;
269 * FROM email address used for receipts generated by contributions to this contribution page.
273 public $receipt_from_email;
275 * comma-separated list of email addresses to cc each time a receipt is sent
281 * comma-separated list of email addresses to bcc each time a receipt is sent
287 * text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now
291 public $receipt_text;
293 * Is this property active?
299 * Text and html allowed. Displayed at the bottom of the first page of the contribution wizard.
305 * Is this property active?
309 public $amount_block_is_active;
311 * Date and time that this page starts.
317 * Date and time that this page ends. May be NULL if no defined end date/time
323 * FK to civicrm_contact, who created this contribution page
329 * Date and time that contribution page was created.
333 public $created_date;
335 * 3 character string, value from config setting or input via user.
341 * The campaign for which we are collecting contributions with this page.
347 * Can people share the contribution page through social media?
353 * if true - billing block is required for online contribution page
357 public $is_billing_required;
361 * @return civicrm_contribution_page
363 function __construct() {
364 $this->__table
= 'civicrm_contribution_page';
365 parent
::__construct();
368 * Returns foreign keys and entity references
371 * [CRM_Core_Reference_Interface]
373 static function getReferenceColumns() {
374 if (!self
::$_links) {
375 self
::$_links = static ::createReferenceColumns(__CLASS__
);
376 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
377 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
378 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'campaign_id', 'civicrm_campaign', 'id');
380 return self
::$_links;
383 * Returns all the column names of this table
387 static function &fields() {
388 if (!(self
::$_fields)) {
389 self
::$_fields = array(
392 'type' => CRM_Utils_Type
::T_INT
,
393 'title' => ts('Contribution Page ID') ,
394 'description' => 'Contribution Id',
399 'type' => CRM_Utils_Type
::T_STRING
,
400 'title' => ts('Contribution Page Title') ,
401 'description' => 'Contribution Page title. For top of page display',
403 'size' => CRM_Utils_Type
::HUGE
,
405 'intro_text' => array(
406 'name' => 'intro_text',
407 'type' => CRM_Utils_Type
::T_TEXT
,
408 'title' => ts('Contribution Page Introduction Text') ,
409 'description' => 'Text and html allowed. Displayed below title.',
413 'type' => 'TextArea',
416 'financial_type_id' => array(
417 'name' => 'financial_type_id',
418 'type' => CRM_Utils_Type
::T_INT
,
419 'title' => ts('Financial Type') ,
420 'description' => 'default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution',
421 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
425 'pseudoconstant' => array(
426 'table' => 'civicrm_financial_type',
428 'labelColumn' => 'name',
431 'payment_processor' => array(
432 'name' => 'payment_processor',
433 'type' => CRM_Utils_Type
::T_STRING
,
434 'title' => ts('Payment Processor') ,
435 'description' => 'Payment Processors configured for this contribution Page',
437 'size' => CRM_Utils_Type
::HUGE
,
441 'pseudoconstant' => array(
442 'table' => 'civicrm_payment_processor',
444 'labelColumn' => 'name',
447 'is_credit_card_only' => array(
448 'name' => 'is_credit_card_only',
449 'type' => CRM_Utils_Type
::T_BOOLEAN
,
450 'title' => ts('Is Credit Card Only?') ,
451 'description' => 'if true - processing logic must reject transaction at confirmation stage if pay method != credit card',
453 'is_monetary' => array(
454 'name' => 'is_monetary',
455 'type' => CRM_Utils_Type
::T_BOOLEAN
,
456 'title' => ts('Is Monetary') ,
457 'description' => 'if true - allows real-time monetary transactions otherwise non-monetary transactions',
461 'name' => 'is_recur',
462 'type' => CRM_Utils_Type
::T_BOOLEAN
,
463 'title' => ts('Is Recurring') ,
464 'description' => 'if true - allows recurring contributions, valid only for PayPal_Standard',
466 'is_confirm_enabled' => array(
467 'name' => 'is_confirm_enabled',
468 'type' => CRM_Utils_Type
::T_BOOLEAN
,
469 'title' => ts('Confirmation Page?') ,
470 'description' => 'if false, the confirm page in contribution pages gets skipped',
473 'recur_frequency_unit' => array(
474 'name' => 'recur_frequency_unit',
475 'type' => CRM_Utils_Type
::T_STRING
,
476 'title' => ts('Recurring Frequency') ,
477 'description' => 'Supported recurring frequency units.',
479 'size' => CRM_Utils_Type
::HUGE
,
481 'is_recur_interval' => array(
482 'name' => 'is_recur_interval',
483 'type' => CRM_Utils_Type
::T_BOOLEAN
,
484 'title' => ts('Support Recurring Intervals') ,
485 'description' => 'if true - supports recurring intervals',
487 'is_recur_installments' => array(
488 'name' => 'is_recur_installments',
489 'type' => CRM_Utils_Type
::T_BOOLEAN
,
490 'title' => ts('Recurring Installments?') ,
491 'description' => 'if true - asks user for recurring installments',
493 'is_pay_later' => array(
494 'name' => 'is_pay_later',
495 'type' => CRM_Utils_Type
::T_BOOLEAN
,
496 'title' => ts('Pay Later') ,
497 'description' => 'if true - allows the user to send payment directly to the org later',
499 'pay_later_text' => array(
500 'name' => 'pay_later_text',
501 'type' => CRM_Utils_Type
::T_TEXT
,
502 'title' => ts('Pay Later Text') ,
503 'description' => 'The text displayed to the user in the main form',
505 'pay_later_receipt' => array(
506 'name' => 'pay_later_receipt',
507 'type' => CRM_Utils_Type
::T_TEXT
,
508 'title' => ts('Pay Later Receipt') ,
509 'description' => 'The receipt sent to the user instead of the normal receipt text',
511 'is_partial_payment' => array(
512 'name' => 'is_partial_payment',
513 'type' => CRM_Utils_Type
::T_BOOLEAN
,
514 'title' => ts('Allow Partial Payment') ,
515 'description' => 'is partial payment enabled for this online contribution page',
517 'initial_amount_label' => array(
518 'name' => 'initial_amount_label',
519 'type' => CRM_Utils_Type
::T_STRING
,
520 'title' => ts('Initial Amount Label') ,
521 'description' => 'Initial amount label for partial payment',
523 'size' => CRM_Utils_Type
::HUGE
,
525 'initial_amount_help_text' => array(
526 'name' => 'initial_amount_help_text',
527 'type' => CRM_Utils_Type
::T_TEXT
,
528 'title' => ts('Initial Amount Help Text') ,
529 'description' => 'Initial amount help text for partial payment',
531 'min_initial_amount' => array(
532 'name' => 'min_initial_amount',
533 'type' => CRM_Utils_Type
::T_MONEY
,
534 'title' => ts('Min Initial Amount') ,
535 'description' => 'Minimum initial amount for partial payment',
536 'precision' => array(
541 'is_allow_other_amount' => array(
542 'name' => 'is_allow_other_amount',
543 'type' => CRM_Utils_Type
::T_BOOLEAN
,
544 'title' => ts('Allow Other Amounts') ,
545 'description' => 'if true, page will include an input text field where user can enter their own amount',
547 'default_amount_id' => array(
548 'name' => 'default_amount_id',
549 'type' => CRM_Utils_Type
::T_INT
,
550 'title' => ts('Default Amount') ,
551 'description' => 'FK to civicrm_option_value.',
553 'min_amount' => array(
554 'name' => 'min_amount',
555 'type' => CRM_Utils_Type
::T_MONEY
,
556 'title' => ts('Minimum Amount') ,
557 'description' => 'if other amounts allowed, user can configure minimum allowed.',
558 'precision' => array(
563 'max_amount' => array(
564 'name' => 'max_amount',
565 'type' => CRM_Utils_Type
::T_MONEY
,
566 'title' => ts('Maximum Amount') ,
567 'description' => 'if other amounts allowed, user can configure maximum allowed.',
568 'precision' => array(
573 'goal_amount' => array(
574 'name' => 'goal_amount',
575 'type' => CRM_Utils_Type
::T_MONEY
,
576 'title' => ts('Goal Amount') ,
577 'description' => 'The target goal for this page, allows people to build a goal meter',
578 'precision' => array(
583 'thankyou_title' => array(
584 'name' => 'thankyou_title',
585 'type' => CRM_Utils_Type
::T_STRING
,
586 'title' => ts('Thank-you Title') ,
587 'description' => 'Title for Thank-you page (header title tag, and display at the top of the page).',
589 'size' => CRM_Utils_Type
::HUGE
,
591 'thankyou_text' => array(
592 'name' => 'thankyou_text',
593 'type' => CRM_Utils_Type
::T_TEXT
,
594 'title' => ts('Thank-you Text') ,
595 'description' => 'text and html allowed. displayed above result on success page',
599 'type' => 'TextArea',
602 'thankyou_footer' => array(
603 'name' => 'thankyou_footer',
604 'type' => CRM_Utils_Type
::T_TEXT
,
605 'title' => ts('Thank-you Footer') ,
606 '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.',
610 'type' => 'TextArea',
613 'is_for_organization' => array(
614 'name' => 'is_for_organization',
615 'type' => CRM_Utils_Type
::T_BOOLEAN
,
616 'title' => ts('Allow For Organization') ,
617 'description' => 'if true, signup is done on behalf of an organization',
619 'for_organization' => array(
620 'name' => 'for_organization',
621 'type' => CRM_Utils_Type
::T_TEXT
,
622 'title' => ts('On Behalf Of Organization') ,
623 'description' => 'This text field is shown when is_for_organization is checked. For example - I am contributing on behalf on an organization.',
627 'type' => 'TextArea',
630 'is_email_receipt' => array(
631 'name' => 'is_email_receipt',
632 'type' => CRM_Utils_Type
::T_BOOLEAN
,
633 'title' => ts('Send email Receipt') ,
634 'description' => 'if true, receipt is automatically emailed to contact on success',
636 'receipt_from_name' => array(
637 'name' => 'receipt_from_name',
638 'type' => CRM_Utils_Type
::T_STRING
,
639 'title' => ts('Receipt From') ,
640 'description' => 'FROM email name used for receipts generated by contributions to this contribution page.',
642 'size' => CRM_Utils_Type
::HUGE
,
644 'receipt_from_email' => array(
645 'name' => 'receipt_from_email',
646 'type' => CRM_Utils_Type
::T_STRING
,
647 'title' => ts('Receipt From email') ,
648 'description' => 'FROM email address used for receipts generated by contributions to this contribution page.',
650 'size' => CRM_Utils_Type
::HUGE
,
652 'cc_receipt' => array(
653 'name' => 'cc_receipt',
654 'type' => CRM_Utils_Type
::T_STRING
,
655 'title' => ts('Receipt cc') ,
656 'description' => 'comma-separated list of email addresses to cc each time a receipt is sent',
658 'size' => CRM_Utils_Type
::HUGE
,
660 'bcc_receipt' => array(
661 'name' => 'bcc_receipt',
662 'type' => CRM_Utils_Type
::T_STRING
,
663 'title' => ts('Receipt bcc') ,
664 'description' => 'comma-separated list of email addresses to bcc each time a receipt is sent',
666 'size' => CRM_Utils_Type
::HUGE
,
668 'receipt_text' => array(
669 'name' => 'receipt_text',
670 'type' => CRM_Utils_Type
::T_TEXT
,
671 'title' => ts('Receipt Text') ,
672 'description' => 'text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now',
676 'type' => 'TextArea',
679 'is_active' => array(
680 'name' => 'is_active',
681 'type' => CRM_Utils_Type
::T_BOOLEAN
,
682 'title' => ts('Is Page Active?') ,
683 'description' => 'Is this property active?',
685 'footer_text' => array(
686 'name' => 'footer_text',
687 'type' => CRM_Utils_Type
::T_TEXT
,
688 'title' => ts('Footer Text') ,
689 'description' => 'Text and html allowed. Displayed at the bottom of the first page of the contribution wizard.',
693 'type' => 'TextArea',
696 'amount_block_is_active' => array(
697 'name' => 'amount_block_is_active',
698 'type' => CRM_Utils_Type
::T_BOOLEAN
,
699 'title' => ts('Is Amount Block Active?') ,
700 'description' => 'Is this property active?',
703 'start_date' => array(
704 'name' => 'start_date',
705 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
706 'title' => ts('Contribution Page Start Date') ,
707 'description' => 'Date and time that this page starts.',
710 'name' => 'end_date',
711 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
712 'title' => ts('Contribution Page End Date') ,
713 'description' => 'Date and time that this page ends. May be NULL if no defined end date/time',
715 'created_id' => array(
716 'name' => 'created_id',
717 'type' => CRM_Utils_Type
::T_INT
,
718 'title' => ts('Contribution Page Created By') ,
719 'description' => 'FK to civicrm_contact, who created this contribution page',
720 'FKClassName' => 'CRM_Contact_DAO_Contact',
722 'created_date' => array(
723 'name' => 'created_date',
724 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
725 'title' => ts('Contribution Page Created Date') ,
726 'description' => 'Date and time that contribution page was created.',
729 'name' => 'currency',
730 'type' => CRM_Utils_Type
::T_STRING
,
731 'title' => ts('Contribution Page Currency') ,
732 'description' => '3 character string, value from config setting or input via user.',
734 'size' => CRM_Utils_Type
::FOUR
,
739 'pseudoconstant' => array(
740 'table' => 'civicrm_currency',
741 'keyColumn' => 'name',
742 'labelColumn' => 'full_name',
743 'nameColumn' => 'numeric_code',
746 'campaign_id' => array(
747 'name' => 'campaign_id',
748 'type' => CRM_Utils_Type
::T_INT
,
749 'title' => ts('Contribution Page Campaign ID') ,
750 'description' => 'The campaign for which we are collecting contributions with this page.',
751 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
752 'pseudoconstant' => array(
753 'table' => 'civicrm_campaign',
755 'labelColumn' => 'title',
759 'name' => 'is_share',
760 'type' => CRM_Utils_Type
::T_BOOLEAN
,
761 'title' => ts('Is Contribution Page Shared?') ,
762 'description' => 'Can people share the contribution page through social media?',
765 'is_billing_required' => array(
766 'name' => 'is_billing_required',
767 'type' => CRM_Utils_Type
::T_BOOLEAN
,
768 'title' => ts('Is billing block required') ,
769 'description' => 'if true - billing block is required for online contribution page',
773 return self
::$_fields;
776 * Returns an array containing, for each field, the arary key used for that
777 * field in self::$_fields.
781 static function &fieldKeys() {
782 if (!(self
::$_fieldKeys)) {
783 self
::$_fieldKeys = array(
786 'intro_text' => 'intro_text',
787 'financial_type_id' => 'financial_type_id',
788 'payment_processor' => 'payment_processor',
789 'is_credit_card_only' => 'is_credit_card_only',
790 'is_monetary' => 'is_monetary',
791 'is_recur' => 'is_recur',
792 'is_confirm_enabled' => 'is_confirm_enabled',
793 'recur_frequency_unit' => 'recur_frequency_unit',
794 'is_recur_interval' => 'is_recur_interval',
795 'is_recur_installments' => 'is_recur_installments',
796 'is_pay_later' => 'is_pay_later',
797 'pay_later_text' => 'pay_later_text',
798 'pay_later_receipt' => 'pay_later_receipt',
799 'is_partial_payment' => 'is_partial_payment',
800 'initial_amount_label' => 'initial_amount_label',
801 'initial_amount_help_text' => 'initial_amount_help_text',
802 'min_initial_amount' => 'min_initial_amount',
803 'is_allow_other_amount' => 'is_allow_other_amount',
804 'default_amount_id' => 'default_amount_id',
805 'min_amount' => 'min_amount',
806 'max_amount' => 'max_amount',
807 'goal_amount' => 'goal_amount',
808 'thankyou_title' => 'thankyou_title',
809 'thankyou_text' => 'thankyou_text',
810 'thankyou_footer' => 'thankyou_footer',
811 'is_for_organization' => 'is_for_organization',
812 'for_organization' => 'for_organization',
813 'is_email_receipt' => 'is_email_receipt',
814 'receipt_from_name' => 'receipt_from_name',
815 'receipt_from_email' => 'receipt_from_email',
816 'cc_receipt' => 'cc_receipt',
817 'bcc_receipt' => 'bcc_receipt',
818 'receipt_text' => 'receipt_text',
819 'is_active' => 'is_active',
820 'footer_text' => 'footer_text',
821 'amount_block_is_active' => 'amount_block_is_active',
822 'start_date' => 'start_date',
823 'end_date' => 'end_date',
824 'created_id' => 'created_id',
825 'created_date' => 'created_date',
826 'currency' => 'currency',
827 'campaign_id' => 'campaign_id',
828 'is_share' => 'is_share',
829 'is_billing_required' => 'is_billing_required',
832 return self
::$_fieldKeys;
835 * Returns the names of this table
839 static function getTableName() {
840 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
843 * Returns if this table needs to be logged
851 * Returns the list of fields that can be imported
853 * @param bool $prefix
857 static function &import($prefix = false) {
858 if (!(self
::$_import)) {
859 self
::$_import = array();
860 $fields = self
::fields();
861 foreach($fields as $name => $field) {
862 if (CRM_Utils_Array
::value('import', $field)) {
864 self
::$_import['contribution_page'] = & $fields[$name];
866 self
::$_import[$name] = & $fields[$name];
871 return self
::$_import;
874 * Returns the list of fields that can be exported
876 * @param bool $prefix
880 static function &export($prefix = false) {
881 if (!(self
::$_export)) {
882 self
::$_export = array();
883 $fields = self
::fields();
884 foreach($fields as $name => $field) {
885 if (CRM_Utils_Array
::value('export', $field)) {
887 self
::$_export['contribution_page'] = & $fields[$name];
889 self
::$_export[$name] = & $fields[$name];
894 return self
::$_export;