Regen DAOs with new import() / export()
[civicrm-core.git] / CRM / Contribute / DAO / Premium.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2016
30 *
31 * Generated from xml/schema/CRM/Contribute/Premium.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:c84ce7b79339fc7842fe872fe75eccc1)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Contribute_DAO_Premium extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_premiums';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
62 /**
63 * static value to see if we should log any modifications to
64 * this table in the civicrm_log table
65 *
66 * @var boolean
67 */
68 static $_log = true;
69 /**
70 *
71 * @var int unsigned
72 */
73 public $id;
74 /**
75 * Joins these premium settings to another object. Always civicrm_contribution_page for now.
76 *
77 * @var string
78 */
79 public $entity_table;
80 /**
81 *
82 * @var int unsigned
83 */
84 public $entity_id;
85 /**
86 * Is the Premiums feature enabled for this page?
87 *
88 * @var boolean
89 */
90 public $premiums_active;
91 /**
92 * Title for Premiums section.
93 *
94 * @var string
95 */
96 public $premiums_intro_title;
97 /**
98 * Displayed in <div> at top of Premiums section of page. Text and HTML allowed.
99 *
100 * @var text
101 */
102 public $premiums_intro_text;
103 /**
104 * This email address is included in receipts if it is populated and a premium has been selected.
105 *
106 * @var string
107 */
108 public $premiums_contact_email;
109 /**
110 * This phone number is included in receipts if it is populated and a premium has been selected.
111 *
112 * @var string
113 */
114 public $premiums_contact_phone;
115 /**
116 * Boolean. Should we automatically display minimum contribution amount text after the premium descriptions.
117 *
118 * @var boolean
119 */
120 public $premiums_display_min_contribution;
121 /**
122 * Label displayed for No Thank-you option in premiums block (e.g. No thank you)
123 *
124 * @var string
125 */
126 public $premiums_nothankyou_label;
127 /**
128 *
129 * @var int unsigned
130 */
131 public $premiums_nothankyou_position;
132 /**
133 * class constructor
134 *
135 * @return civicrm_premiums
136 */
137 function __construct() {
138 $this->__table = 'civicrm_premiums';
139 parent::__construct();
140 }
141 /**
142 * Returns foreign keys and entity references
143 *
144 * @return array
145 * [CRM_Core_Reference_Interface]
146 */
147 static function getReferenceColumns() {
148 if (!self::$_links) {
149 self::$_links = static ::createReferenceColumns(__CLASS__);
150 self::$_links[] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
151 }
152 return self::$_links;
153 }
154 /**
155 * Returns all the column names of this table
156 *
157 * @return array
158 */
159 static function &fields() {
160 if (!(self::$_fields)) {
161 self::$_fields = array(
162 'id' => array(
163 'name' => 'id',
164 'type' => CRM_Utils_Type::T_INT,
165 'title' => ts('Premium ID') ,
166 'required' => true,
167 ) ,
168 'entity_table' => array(
169 'name' => 'entity_table',
170 'type' => CRM_Utils_Type::T_STRING,
171 'title' => ts('Premium Entity') ,
172 'description' => 'Joins these premium settings to another object. Always civicrm_contribution_page for now.',
173 'required' => true,
174 'maxlength' => 64,
175 'size' => CRM_Utils_Type::BIG,
176 ) ,
177 'entity_id' => array(
178 'name' => 'entity_id',
179 'type' => CRM_Utils_Type::T_INT,
180 'title' => ts('Premium entity ID') ,
181 'required' => true,
182 ) ,
183 'premiums_active' => array(
184 'name' => 'premiums_active',
185 'type' => CRM_Utils_Type::T_BOOLEAN,
186 'title' => ts('Is Premium Active?') ,
187 'description' => 'Is the Premiums feature enabled for this page?',
188 'required' => true,
189 ) ,
190 'premiums_intro_title' => array(
191 'name' => 'premiums_intro_title',
192 'type' => CRM_Utils_Type::T_STRING,
193 'title' => ts('Title for Premiums section') ,
194 'description' => 'Title for Premiums section.',
195 'maxlength' => 255,
196 'size' => CRM_Utils_Type::HUGE,
197 ) ,
198 'premiums_intro_text' => array(
199 'name' => 'premiums_intro_text',
200 'type' => CRM_Utils_Type::T_TEXT,
201 'title' => ts('Premium Introductory Text') ,
202 'description' => 'Displayed in <div> at top of Premiums section of page. Text and HTML allowed.',
203 ) ,
204 'premiums_contact_email' => array(
205 'name' => 'premiums_contact_email',
206 'type' => CRM_Utils_Type::T_STRING,
207 'title' => ts('Premium Contact Email') ,
208 'description' => 'This email address is included in receipts if it is populated and a premium has been selected.',
209 'maxlength' => 100,
210 'size' => CRM_Utils_Type::HUGE,
211 ) ,
212 'premiums_contact_phone' => array(
213 'name' => 'premiums_contact_phone',
214 'type' => CRM_Utils_Type::T_STRING,
215 'title' => ts('Premiums Contact Phone') ,
216 'description' => 'This phone number is included in receipts if it is populated and a premium has been selected.',
217 'maxlength' => 50,
218 'size' => CRM_Utils_Type::BIG,
219 ) ,
220 'premiums_display_min_contribution' => array(
221 'name' => 'premiums_display_min_contribution',
222 'type' => CRM_Utils_Type::T_BOOLEAN,
223 'title' => ts('Display Minimum Contribution?') ,
224 'description' => 'Boolean. Should we automatically display minimum contribution amount text after the premium descriptions.',
225 'required' => true,
226 ) ,
227 'premiums_nothankyou_label' => array(
228 'name' => 'premiums_nothankyou_label',
229 'type' => CRM_Utils_Type::T_STRING,
230 'title' => ts('No Thank-you Text') ,
231 'description' => 'Label displayed for No Thank-you option in premiums block (e.g. No thank you)',
232 'maxlength' => 255,
233 'size' => CRM_Utils_Type::HUGE,
234 ) ,
235 'premiums_nothankyou_position' => array(
236 'name' => 'premiums_nothankyou_position',
237 'type' => CRM_Utils_Type::T_INT,
238 'title' => ts('No Thank-you Position') ,
239 'default' => '1',
240 ) ,
241 );
242 }
243 return self::$_fields;
244 }
245 /**
246 * Returns an array containing, for each field, the arary key used for that
247 * field in self::$_fields.
248 *
249 * @return array
250 */
251 static function &fieldKeys() {
252 if (!(self::$_fieldKeys)) {
253 self::$_fieldKeys = array(
254 'id' => 'id',
255 'entity_table' => 'entity_table',
256 'entity_id' => 'entity_id',
257 'premiums_active' => 'premiums_active',
258 'premiums_intro_title' => 'premiums_intro_title',
259 'premiums_intro_text' => 'premiums_intro_text',
260 'premiums_contact_email' => 'premiums_contact_email',
261 'premiums_contact_phone' => 'premiums_contact_phone',
262 'premiums_display_min_contribution' => 'premiums_display_min_contribution',
263 'premiums_nothankyou_label' => 'premiums_nothankyou_label',
264 'premiums_nothankyou_position' => 'premiums_nothankyou_position',
265 );
266 }
267 return self::$_fieldKeys;
268 }
269 /**
270 * Returns the names of this table
271 *
272 * @return string
273 */
274 static function getTableName() {
275 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
276 }
277 /**
278 * Returns if this table needs to be logged
279 *
280 * @return boolean
281 */
282 function getLog() {
283 return self::$_log;
284 }
285 /**
286 * Returns the list of fields that can be imported
287 *
288 * @param bool $prefix
289 *
290 * @return array
291 */
292 static function &import($prefix = false) {
293 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'premiums', $prefix, array());
294 return $r;
295 }
296 /**
297 * Returns the list of fields that can be exported
298 *
299 * @param bool $prefix
300 *
301 * @return array
302 */
303 static function &export($prefix = false) {
304 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'premiums', $prefix, array());
305 return $r;
306 }
307 }