3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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-2017
31 * Generated from xml/schema/CRM/Contribute/Premium.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:c84ce7b79339fc7842fe872fe75eccc1)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Contribute_DAO_Premium
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_premiums';
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
57 * Joins these premium settings to another object. Always civicrm_contribution_page for now.
68 * Is the Premiums feature enabled for this page?
72 public $premiums_active;
74 * Title for Premiums section.
78 public $premiums_intro_title;
80 * Displayed in <div> at top of Premiums section of page. Text and HTML allowed.
84 public $premiums_intro_text;
86 * This email address is included in receipts if it is populated and a premium has been selected.
90 public $premiums_contact_email;
92 * This phone number is included in receipts if it is populated and a premium has been selected.
96 public $premiums_contact_phone;
98 * Boolean. Should we automatically display minimum contribution amount text after the premium descriptions.
102 public $premiums_display_min_contribution;
104 * Label displayed for No Thank-you option in premiums block (e.g. No thank you)
108 public $premiums_nothankyou_label;
113 public $premiums_nothankyou_position;
117 * @return civicrm_premiums
119 function __construct() {
120 $this->__table
= 'civicrm_premiums';
121 parent
::__construct();
124 * Returns foreign keys and entity references
127 * [CRM_Core_Reference_Interface]
129 static function getReferenceColumns() {
130 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
131 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
132 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
133 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
135 return Civi
::$statics[__CLASS__
]['links'];
138 * Returns all the column names of this table
142 static function &fields() {
143 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
144 Civi
::$statics[__CLASS__
]['fields'] = array(
147 'type' => CRM_Utils_Type
::T_INT
,
148 'title' => ts('Premium ID') ,
151 'entity_table' => array(
152 'name' => 'entity_table',
153 'type' => CRM_Utils_Type
::T_STRING
,
154 'title' => ts('Premium Entity') ,
155 'description' => 'Joins these premium settings to another object. Always civicrm_contribution_page for now.',
158 'size' => CRM_Utils_Type
::BIG
,
160 'entity_id' => array(
161 'name' => 'entity_id',
162 'type' => CRM_Utils_Type
::T_INT
,
163 'title' => ts('Premium entity ID') ,
166 'premiums_active' => array(
167 'name' => 'premiums_active',
168 'type' => CRM_Utils_Type
::T_BOOLEAN
,
169 'title' => ts('Is Premium Active?') ,
170 'description' => 'Is the Premiums feature enabled for this page?',
173 'premiums_intro_title' => array(
174 'name' => 'premiums_intro_title',
175 'type' => CRM_Utils_Type
::T_STRING
,
176 'title' => ts('Title for Premiums section') ,
177 'description' => 'Title for Premiums section.',
179 'size' => CRM_Utils_Type
::HUGE
,
181 'premiums_intro_text' => array(
182 'name' => 'premiums_intro_text',
183 'type' => CRM_Utils_Type
::T_TEXT
,
184 'title' => ts('Premium Introductory Text') ,
185 'description' => 'Displayed in <div> at top of Premiums section of page. Text and HTML allowed.',
187 'premiums_contact_email' => array(
188 'name' => 'premiums_contact_email',
189 'type' => CRM_Utils_Type
::T_STRING
,
190 'title' => ts('Premium Contact Email') ,
191 'description' => 'This email address is included in receipts if it is populated and a premium has been selected.',
193 'size' => CRM_Utils_Type
::HUGE
,
195 'premiums_contact_phone' => array(
196 'name' => 'premiums_contact_phone',
197 'type' => CRM_Utils_Type
::T_STRING
,
198 'title' => ts('Premiums Contact Phone') ,
199 'description' => 'This phone number is included in receipts if it is populated and a premium has been selected.',
201 'size' => CRM_Utils_Type
::BIG
,
203 'premiums_display_min_contribution' => array(
204 'name' => 'premiums_display_min_contribution',
205 'type' => CRM_Utils_Type
::T_BOOLEAN
,
206 'title' => ts('Display Minimum Contribution?') ,
207 'description' => 'Boolean. Should we automatically display minimum contribution amount text after the premium descriptions.',
210 'premiums_nothankyou_label' => array(
211 'name' => 'premiums_nothankyou_label',
212 'type' => CRM_Utils_Type
::T_STRING
,
213 'title' => ts('No Thank-you Text') ,
214 'description' => 'Label displayed for No Thank-you option in premiums block (e.g. No thank you)',
216 'size' => CRM_Utils_Type
::HUGE
,
218 'premiums_nothankyou_position' => array(
219 'name' => 'premiums_nothankyou_position',
220 'type' => CRM_Utils_Type
::T_INT
,
221 'title' => ts('No Thank-you Position') ,
225 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
227 return Civi
::$statics[__CLASS__
]['fields'];
230 * Return a mapping from field-name to the corresponding key (as used in fields()).
233 * Array(string $name => string $uniqueName).
235 static function &fieldKeys() {
236 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
237 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
239 return Civi
::$statics[__CLASS__
]['fieldKeys'];
242 * Returns the names of this table
246 static function getTableName() {
247 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
250 * Returns if this table needs to be logged
258 * Returns the list of fields that can be imported
260 * @param bool $prefix
264 static function &import($prefix = false) {
265 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'premiums', $prefix, array());
269 * Returns the list of fields that can be exported
271 * @param bool $prefix
275 static function &export($prefix = false) {
276 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'premiums', $prefix, array());