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/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 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
89 * Joins these premium settings to another object. Always civicrm_contribution_page for now.
100 * Is the Premiums feature enabled for this page?
104 public $premiums_active;
106 * Title for Premiums section.
110 public $premiums_intro_title;
112 * Displayed in <div> at top of Premiums section of page. Text and HTML allowed.
116 public $premiums_intro_text;
118 * This email address is included in receipts if it is populated and a premium has been selected.
122 public $premiums_contact_email;
124 * This phone number is included in receipts if it is populated and a premium has been selected.
128 public $premiums_contact_phone;
130 * Boolean. Should we automatically display minimum contribution amount text after the premium descriptions.
134 public $premiums_display_min_contribution;
136 * Label displayed for No Thank-you option in premiums block (e.g. No thank you)
140 public $premiums_nothankyou_label;
145 public $premiums_nothankyou_position;
149 * @return civicrm_premiums
151 function __construct() {
152 $this->__table
= 'civicrm_premiums';
153 parent
::__construct();
156 * Returns foreign keys and entity references
159 * [CRM_Core_Reference_Interface]
161 static function getReferenceColumns() {
162 if (!self
::$_links) {
163 self
::$_links = static ::createReferenceColumns(__CLASS__
);
164 self
::$_links[] = new CRM_Core_Reference_Dynamic(self
::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
166 return self
::$_links;
169 * Returns all the column names of this table
173 static function &fields() {
174 if (!(self
::$_fields)) {
175 self
::$_fields = array(
178 'type' => CRM_Utils_Type
::T_INT
,
179 'title' => ts('Premium ID') ,
182 'entity_table' => array(
183 'name' => 'entity_table',
184 'type' => CRM_Utils_Type
::T_STRING
,
185 'title' => ts('Premium Entity') ,
186 'description' => 'Joins these premium settings to another object. Always civicrm_contribution_page for now.',
189 'size' => CRM_Utils_Type
::BIG
,
191 'entity_id' => array(
192 'name' => 'entity_id',
193 'type' => CRM_Utils_Type
::T_INT
,
194 'title' => ts('Premium entity ID') ,
197 'premiums_active' => array(
198 'name' => 'premiums_active',
199 'type' => CRM_Utils_Type
::T_BOOLEAN
,
200 'title' => ts('Is Premium Active?') ,
201 'description' => 'Is the Premiums feature enabled for this page?',
204 'premiums_intro_title' => array(
205 'name' => 'premiums_intro_title',
206 'type' => CRM_Utils_Type
::T_STRING
,
207 'title' => ts('Title for Premiums section') ,
208 'description' => 'Title for Premiums section.',
210 'size' => CRM_Utils_Type
::HUGE
,
212 'premiums_intro_text' => array(
213 'name' => 'premiums_intro_text',
214 'type' => CRM_Utils_Type
::T_TEXT
,
215 'title' => ts('Premium Introductory Text') ,
216 'description' => 'Displayed in <div> at top of Premiums section of page. Text and HTML allowed.',
218 'premiums_contact_email' => array(
219 'name' => 'premiums_contact_email',
220 'type' => CRM_Utils_Type
::T_STRING
,
221 'title' => ts('Premium Contact Email') ,
222 'description' => 'This email address is included in receipts if it is populated and a premium has been selected.',
224 'size' => CRM_Utils_Type
::HUGE
,
226 'premiums_contact_phone' => array(
227 'name' => 'premiums_contact_phone',
228 'type' => CRM_Utils_Type
::T_STRING
,
229 'title' => ts('Premiums Contact Phone') ,
230 'description' => 'This phone number is included in receipts if it is populated and a premium has been selected.',
232 'size' => CRM_Utils_Type
::BIG
,
234 'premiums_display_min_contribution' => array(
235 'name' => 'premiums_display_min_contribution',
236 'type' => CRM_Utils_Type
::T_BOOLEAN
,
237 'title' => ts('Display Minimum Contribution?') ,
238 'description' => 'Boolean. Should we automatically display minimum contribution amount text after the premium descriptions.',
241 'premiums_nothankyou_label' => array(
242 'name' => 'premiums_nothankyou_label',
243 'type' => CRM_Utils_Type
::T_STRING
,
244 'title' => ts('No Thank-you Text') ,
245 'description' => 'Label displayed for No Thank-you option in premiums block (e.g. No thank you)',
247 'size' => CRM_Utils_Type
::HUGE
,
249 'premiums_nothankyou_position' => array(
250 'name' => 'premiums_nothankyou_position',
251 'type' => CRM_Utils_Type
::T_INT
,
252 'title' => ts('No Thank-you Position') ,
257 return self
::$_fields;
260 * Returns an array containing, for each field, the arary key used for that
261 * field in self::$_fields.
265 static function &fieldKeys() {
266 if (!(self
::$_fieldKeys)) {
267 self
::$_fieldKeys = array(
269 'entity_table' => 'entity_table',
270 'entity_id' => 'entity_id',
271 'premiums_active' => 'premiums_active',
272 'premiums_intro_title' => 'premiums_intro_title',
273 'premiums_intro_text' => 'premiums_intro_text',
274 'premiums_contact_email' => 'premiums_contact_email',
275 'premiums_contact_phone' => 'premiums_contact_phone',
276 'premiums_display_min_contribution' => 'premiums_display_min_contribution',
277 'premiums_nothankyou_label' => 'premiums_nothankyou_label',
278 'premiums_nothankyou_position' => 'premiums_nothankyou_position',
281 return self
::$_fieldKeys;
284 * Returns the names of this table
288 static function getTableName() {
289 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
292 * Returns if this table needs to be logged
300 * Returns the list of fields that can be imported
302 * @param bool $prefix
306 static function &import($prefix = false) {
307 if (!(self
::$_import)) {
308 self
::$_import = array();
309 $fields = self
::fields();
310 foreach($fields as $name => $field) {
311 if (CRM_Utils_Array
::value('import', $field)) {
313 self
::$_import['premiums'] = & $fields[$name];
315 self
::$_import[$name] = & $fields[$name];
320 return self
::$_import;
323 * Returns the list of fields that can be exported
325 * @param bool $prefix
329 static function &export($prefix = false) {
330 if (!(self
::$_export)) {
331 self
::$_export = array();
332 $fields = self
::fields();
333 foreach($fields as $name => $field) {
334 if (CRM_Utils_Array
::value('export', $field)) {
336 self
::$_export['premiums'] = & $fields[$name];
338 self
::$_export[$name] = & $fields[$name];
343 return self
::$_export;