CRM-20312 regenerated DAO with localisation
[civicrm-core.git] / CRM / Price / DAO / PriceSet.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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-2017
30 *
31 * Generated from xml/schema/CRM/Price/PriceSet.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:0b3a382a33511312a5f3b909f214345d)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Price_DAO_PriceSet constructor.
39 */
40 class CRM_Price_DAO_PriceSet extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_price_set';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
49 *
50 * @var boolean
51 */
52 static $_log = true;
53 /**
54 * Price Set
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * Which Domain is this price-set for
61 *
62 * @var int unsigned
63 */
64 public $domain_id;
65 /**
66 * Variable name/programmatic handle for this set of price fields.
67 *
68 * @var string
69 */
70 public $name;
71 /**
72 * Displayed title for the Price Set.
73 *
74 * @var string
75 */
76 public $title;
77 /**
78 * Is this price set active
79 *
80 * @var boolean
81 */
82 public $is_active;
83 /**
84 * Description and/or help text to display before fields in form.
85 *
86 * @var text
87 */
88 public $help_pre;
89 /**
90 * Description and/or help text to display after fields in form.
91 *
92 * @var text
93 */
94 public $help_post;
95 /**
96 * Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional
97 *
98 * @var string
99 */
100 public $javascript;
101 /**
102 * What components are using this price set?
103 *
104 * @var string
105 */
106 public $extends;
107 /**
108 * FK to Financial Type(for membership price sets only).
109 *
110 * @var int unsigned
111 */
112 public $financial_type_id;
113 /**
114 * Is set if edited on Contribution or Event Page rather than through Manage Price Sets
115 *
116 * @var boolean
117 */
118 public $is_quick_config;
119 /**
120 * Is this a predefined system price set (i.e. it can not be deleted, edited)?
121 *
122 * @var boolean
123 */
124 public $is_reserved;
125 /**
126 * Minimum Amount required for this set.
127 *
128 * @var int unsigned
129 */
130 public $min_amount;
131 /**
132 * Class constructor.
133 */
134 function __construct() {
135 $this->__table = 'civicrm_price_set';
136 parent::__construct();
137 }
138 /**
139 * Returns foreign keys and entity references.
140 *
141 * @return array
142 * [CRM_Core_Reference_Interface]
143 */
144 static function getReferenceColumns() {
145 if (!isset(Civi::$statics[__CLASS__]['links'])) {
146 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
147 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id');
148 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
149 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
150 }
151 return Civi::$statics[__CLASS__]['links'];
152 }
153 /**
154 * Returns all the column names of this table
155 *
156 * @return array
157 */
158 static function &fields() {
159 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
160 Civi::$statics[__CLASS__]['fields'] = array(
161 'id' => array(
162 'name' => 'id',
163 'type' => CRM_Utils_Type::T_INT,
164 'title' => ts('Price Set ID') ,
165 'description' => 'Price Set',
166 'required' => true,
167 'table_name' => 'civicrm_price_set',
168 'entity' => 'PriceSet',
169 'bao' => 'CRM_Price_BAO_PriceSet',
170 'localizable' => 0,
171 ) ,
172 'domain_id' => array(
173 'name' => 'domain_id',
174 'type' => CRM_Utils_Type::T_INT,
175 'title' => ts('Price Set Domain') ,
176 'description' => 'Which Domain is this price-set for',
177 'table_name' => 'civicrm_price_set',
178 'entity' => 'PriceSet',
179 'bao' => 'CRM_Price_BAO_PriceSet',
180 'localizable' => 0,
181 'FKClassName' => 'CRM_Core_DAO_Domain',
182 'html' => array(
183 'type' => 'Text',
184 ) ,
185 'pseudoconstant' => array(
186 'table' => 'civicrm_domain',
187 'keyColumn' => 'id',
188 'labelColumn' => 'name',
189 )
190 ) ,
191 'name' => array(
192 'name' => 'name',
193 'type' => CRM_Utils_Type::T_STRING,
194 'title' => ts('Name') ,
195 'description' => 'Variable name/programmatic handle for this set of price fields.',
196 'required' => true,
197 'maxlength' => 255,
198 'size' => CRM_Utils_Type::HUGE,
199 'table_name' => 'civicrm_price_set',
200 'entity' => 'PriceSet',
201 'bao' => 'CRM_Price_BAO_PriceSet',
202 'localizable' => 0,
203 'html' => array(
204 'type' => 'Text',
205 ) ,
206 ) ,
207 'title' => array(
208 'name' => 'title',
209 'type' => CRM_Utils_Type::T_STRING,
210 'title' => ts('Price Set Title') ,
211 'description' => 'Displayed title for the Price Set.',
212 'required' => true,
213 'maxlength' => 255,
214 'size' => CRM_Utils_Type::HUGE,
215 'table_name' => 'civicrm_price_set',
216 'entity' => 'PriceSet',
217 'bao' => 'CRM_Price_BAO_PriceSet',
218 'localizable' => 1,
219 'html' => array(
220 'type' => 'Text',
221 ) ,
222 ) ,
223 'is_active' => array(
224 'name' => 'is_active',
225 'type' => CRM_Utils_Type::T_BOOLEAN,
226 'title' => ts('Price Set Is Active?') ,
227 'description' => 'Is this price set active',
228 'default' => '1',
229 'table_name' => 'civicrm_price_set',
230 'entity' => 'PriceSet',
231 'bao' => 'CRM_Price_BAO_PriceSet',
232 'localizable' => 0,
233 'html' => array(
234 'type' => 'CheckBox',
235 ) ,
236 ) ,
237 'help_pre' => array(
238 'name' => 'help_pre',
239 'type' => CRM_Utils_Type::T_TEXT,
240 'title' => ts('Price Set Pre Help') ,
241 'description' => 'Description and/or help text to display before fields in form.',
242 'rows' => 4,
243 'cols' => 80,
244 'table_name' => 'civicrm_price_set',
245 'entity' => 'PriceSet',
246 'bao' => 'CRM_Price_BAO_PriceSet',
247 'localizable' => 1,
248 'html' => array(
249 'type' => 'TextArea',
250 ) ,
251 ) ,
252 'help_post' => array(
253 'name' => 'help_post',
254 'type' => CRM_Utils_Type::T_TEXT,
255 'title' => ts('Price Set Post Help') ,
256 'description' => 'Description and/or help text to display after fields in form.',
257 'rows' => 4,
258 'cols' => 80,
259 'table_name' => 'civicrm_price_set',
260 'entity' => 'PriceSet',
261 'bao' => 'CRM_Price_BAO_PriceSet',
262 'localizable' => 1,
263 'html' => array(
264 'type' => 'TextArea',
265 ) ,
266 ) ,
267 'javascript' => array(
268 'name' => 'javascript',
269 'type' => CRM_Utils_Type::T_STRING,
270 'title' => ts('Price Set Javascript') ,
271 'description' => 'Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional',
272 'maxlength' => 64,
273 'size' => CRM_Utils_Type::BIG,
274 'table_name' => 'civicrm_price_set',
275 'entity' => 'PriceSet',
276 'bao' => 'CRM_Price_BAO_PriceSet',
277 'localizable' => 0,
278 'html' => array(
279 'type' => 'Text',
280 ) ,
281 ) ,
282 'extends' => array(
283 'name' => 'extends',
284 'type' => CRM_Utils_Type::T_STRING,
285 'title' => ts('Price Set Extends') ,
286 'description' => 'What components are using this price set?',
287 'required' => true,
288 'maxlength' => 255,
289 'size' => CRM_Utils_Type::HUGE,
290 'table_name' => 'civicrm_price_set',
291 'entity' => 'PriceSet',
292 'bao' => 'CRM_Price_BAO_PriceSet',
293 'localizable' => 0,
294 'html' => array(
295 'type' => 'Text',
296 ) ,
297 'pseudoconstant' => array(
298 'table' => 'civicrm_component',
299 'keyColumn' => 'id',
300 'labelColumn' => 'name',
301 )
302 ) ,
303 'financial_type_id' => array(
304 'name' => 'financial_type_id',
305 'type' => CRM_Utils_Type::T_INT,
306 'title' => ts('Financial Type') ,
307 'description' => 'FK to Financial Type(for membership price sets only).',
308 'default' => 'NULL',
309 'table_name' => 'civicrm_price_set',
310 'entity' => 'PriceSet',
311 'bao' => 'CRM_Price_BAO_PriceSet',
312 'localizable' => 0,
313 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
314 'html' => array(
315 'type' => 'Select',
316 ) ,
317 'pseudoconstant' => array(
318 'table' => 'civicrm_financial_type',
319 'keyColumn' => 'id',
320 'labelColumn' => 'name',
321 )
322 ) ,
323 'is_quick_config' => array(
324 'name' => 'is_quick_config',
325 'type' => CRM_Utils_Type::T_BOOLEAN,
326 'title' => ts('Is Price Set Quick Config?') ,
327 'description' => 'Is set if edited on Contribution or Event Page rather than through Manage Price Sets',
328 'table_name' => 'civicrm_price_set',
329 'entity' => 'PriceSet',
330 'bao' => 'CRM_Price_BAO_PriceSet',
331 'localizable' => 0,
332 'html' => array(
333 'type' => 'CheckBox',
334 ) ,
335 ) ,
336 'is_reserved' => array(
337 'name' => 'is_reserved',
338 'type' => CRM_Utils_Type::T_BOOLEAN,
339 'title' => ts('Price Set Is Reserved') ,
340 'description' => 'Is this a predefined system price set (i.e. it can not be deleted, edited)?',
341 'table_name' => 'civicrm_price_set',
342 'entity' => 'PriceSet',
343 'bao' => 'CRM_Price_BAO_PriceSet',
344 'localizable' => 0,
345 'html' => array(
346 'type' => 'CheckBox',
347 ) ,
348 ) ,
349 'min_amount' => array(
350 'name' => 'min_amount',
351 'type' => CRM_Utils_Type::T_INT,
352 'title' => ts('Minimum Amount') ,
353 'description' => 'Minimum Amount required for this set.',
354 'table_name' => 'civicrm_price_set',
355 'entity' => 'PriceSet',
356 'bao' => 'CRM_Price_BAO_PriceSet',
357 'localizable' => 0,
358 'html' => array(
359 'type' => 'Text',
360 ) ,
361 ) ,
362 );
363 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
364 }
365 return Civi::$statics[__CLASS__]['fields'];
366 }
367 /**
368 * Return a mapping from field-name to the corresponding key (as used in fields()).
369 *
370 * @return array
371 * Array(string $name => string $uniqueName).
372 */
373 static function &fieldKeys() {
374 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
375 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
376 }
377 return Civi::$statics[__CLASS__]['fieldKeys'];
378 }
379 /**
380 * Returns the names of this table
381 *
382 * @return string
383 */
384 static function getTableName() {
385 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
386 }
387 /**
388 * Returns if this table needs to be logged
389 *
390 * @return boolean
391 */
392 function getLog() {
393 return self::$_log;
394 }
395 /**
396 * Returns the list of fields that can be imported
397 *
398 * @param bool $prefix
399 *
400 * @return array
401 */
402 static function &import($prefix = false) {
403 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'price_set', $prefix, array());
404 return $r;
405 }
406 /**
407 * Returns the list of fields that can be exported
408 *
409 * @param bool $prefix
410 *
411 * @return array
412 */
413 static function &export($prefix = false) {
414 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'price_set', $prefix, array());
415 return $r;
416 }
417 }