Commit | Line | Data |
---|---|---|
e501603b TO |
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/Price/PriceFieldValue.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
437fafcf | 33 | * (GenCodeChecksum:14d1591a915f160a115553bc53439d1a) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
37 | class CRM_Price_DAO_PriceFieldValue extends CRM_Core_DAO { | |
38 | /** | |
39 | * static instance to hold the table name | |
40 | * | |
41 | * @var string | |
42 | */ | |
43 | static $_tableName = 'civicrm_price_field_value'; | |
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 instance to hold the values that can | |
64 | * be imported | |
65 | * | |
66 | * @var array | |
67 | */ | |
68 | static $_import = null; | |
69 | /** | |
70 | * static instance to hold the values that can | |
71 | * be exported | |
72 | * | |
73 | * @var array | |
74 | */ | |
75 | static $_export = null; | |
76 | /** | |
77 | * static value to see if we should log any modifications to | |
78 | * this table in the civicrm_log table | |
79 | * | |
80 | * @var boolean | |
81 | */ | |
82 | static $_log = false; | |
83 | /** | |
84 | * Price Field Value | |
85 | * | |
86 | * @var int unsigned | |
87 | */ | |
88 | public $id; | |
89 | /** | |
90 | * FK to civicrm_price_field | |
91 | * | |
92 | * @var int unsigned | |
93 | */ | |
94 | public $price_field_id; | |
95 | /** | |
96 | * Price field option name | |
97 | * | |
98 | * @var string | |
99 | */ | |
100 | public $name; | |
101 | /** | |
102 | * Price field option label | |
103 | * | |
104 | * @var string | |
105 | */ | |
106 | public $label; | |
107 | /** | |
108 | * >Price field option description. | |
109 | * | |
110 | * @var text | |
111 | */ | |
112 | public $description; | |
113 | /** | |
114 | * Price field option pre help text. | |
115 | * | |
116 | * @var text | |
117 | */ | |
118 | public $help_pre; | |
119 | /** | |
120 | * Price field option post field help. | |
121 | * | |
122 | * @var text | |
123 | */ | |
124 | public $help_post; | |
125 | /** | |
126 | * Price field option amount | |
127 | * | |
128 | * @var string | |
129 | */ | |
130 | public $amount; | |
131 | /** | |
132 | * Number of participants per field option | |
133 | * | |
134 | * @var int unsigned | |
135 | */ | |
136 | public $count; | |
137 | /** | |
138 | * Max number of participants per field options | |
139 | * | |
140 | * @var int unsigned | |
141 | */ | |
142 | public $max_value; | |
143 | /** | |
144 | * Order in which the field options should appear | |
145 | * | |
146 | * @var int | |
147 | */ | |
148 | public $weight; | |
149 | /** | |
150 | * FK to Membership Type | |
151 | * | |
152 | * @var int unsigned | |
153 | */ | |
154 | public $membership_type_id; | |
155 | /** | |
156 | * Number of terms for this membership | |
157 | * | |
158 | * @var int unsigned | |
159 | */ | |
160 | public $membership_num_terms; | |
161 | /** | |
162 | * Is this default price field option | |
163 | * | |
164 | * @var boolean | |
165 | */ | |
166 | public $is_default; | |
167 | /** | |
168 | * Is this price field value active | |
169 | * | |
170 | * @var boolean | |
171 | */ | |
172 | public $is_active; | |
173 | /** | |
174 | * FK to Financial Type. | |
175 | * | |
176 | * @var int unsigned | |
177 | */ | |
178 | public $financial_type_id; | |
179 | /** | |
180 | * Tax-deductible portion of the amount | |
181 | * | |
182 | * @var float | |
183 | */ | |
184 | public $deductible_amount; | |
185 | /** | |
186 | * class constructor | |
187 | * | |
188 | * @return civicrm_price_field_value | |
189 | */ | |
190 | function __construct() { | |
191 | $this->__table = 'civicrm_price_field_value'; | |
192 | parent::__construct(); | |
193 | } | |
194 | /** | |
195 | * Returns foreign keys and entity references | |
196 | * | |
197 | * @return array | |
198 | * [CRM_Core_Reference_Interface] | |
199 | */ | |
200 | static function getReferenceColumns() { | |
201 | if (!self::$_links) { | |
202 | self::$_links = static ::createReferenceColumns(__CLASS__); | |
203 | self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'price_field_id', 'civicrm_price_field', 'id'); | |
204 | self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'membership_type_id', 'civicrm_membership_type', 'id'); | |
205 | self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id'); | |
206 | } | |
207 | return self::$_links; | |
208 | } | |
209 | /** | |
210 | * Returns all the column names of this table | |
211 | * | |
212 | * @return array | |
213 | */ | |
214 | static function &fields() { | |
215 | if (!(self::$_fields)) { | |
216 | self::$_fields = array( | |
217 | 'id' => array( | |
218 | 'name' => 'id', | |
219 | 'type' => CRM_Utils_Type::T_INT, | |
220 | 'title' => ts('Price Field Value ID') , | |
221 | 'description' => 'Price Field Value', | |
222 | 'required' => true, | |
223 | ) , | |
224 | 'price_field_id' => array( | |
225 | 'name' => 'price_field_id', | |
226 | 'type' => CRM_Utils_Type::T_INT, | |
227 | 'title' => ts('Price Field') , | |
228 | 'description' => 'FK to civicrm_price_field', | |
229 | 'required' => true, | |
230 | 'FKClassName' => 'CRM_Price_DAO_PriceField', | |
231 | ) , | |
232 | 'name' => array( | |
233 | 'name' => 'name', | |
234 | 'type' => CRM_Utils_Type::T_STRING, | |
235 | 'title' => ts('Name') , | |
236 | 'description' => 'Price field option name', | |
237 | 'maxlength' => 255, | |
238 | 'size' => CRM_Utils_Type::HUGE, | |
239 | 'html' => array( | |
240 | 'type' => 'Text', | |
241 | ) , | |
242 | ) , | |
243 | 'label' => array( | |
244 | 'name' => 'label', | |
245 | 'type' => CRM_Utils_Type::T_STRING, | |
246 | 'title' => ts('Label') , | |
247 | 'description' => 'Price field option label', | |
248 | 'maxlength' => 255, | |
249 | 'size' => CRM_Utils_Type::HUGE, | |
250 | 'html' => array( | |
251 | 'type' => 'Text', | |
252 | ) , | |
253 | ) , | |
254 | 'description' => array( | |
255 | 'name' => 'description', | |
256 | 'type' => CRM_Utils_Type::T_TEXT, | |
257 | 'title' => ts('Description') , | |
258 | 'description' => '>Price field option description.', | |
259 | 'rows' => 2, | |
260 | 'cols' => 60, | |
261 | 'default' => 'NULL', | |
262 | 'html' => array( | |
263 | 'type' => 'TextArea', | |
264 | ) , | |
265 | ) , | |
266 | 'help_pre' => array( | |
267 | 'name' => 'help_pre', | |
268 | 'type' => CRM_Utils_Type::T_TEXT, | |
269 | 'title' => ts('Help Pre') , | |
270 | 'description' => 'Price field option pre help text.', | |
271 | 'rows' => 2, | |
272 | 'cols' => 60, | |
273 | 'default' => 'NULL', | |
274 | 'html' => array( | |
275 | 'type' => 'TextArea', | |
276 | ) , | |
277 | ) , | |
278 | 'help_post' => array( | |
279 | 'name' => 'help_post', | |
280 | 'type' => CRM_Utils_Type::T_TEXT, | |
281 | 'title' => ts('Help Post') , | |
282 | 'description' => 'Price field option post field help.', | |
283 | 'rows' => 2, | |
284 | 'cols' => 60, | |
285 | 'default' => 'NULL', | |
286 | 'html' => array( | |
287 | 'type' => 'TextArea', | |
288 | ) , | |
289 | ) , | |
290 | 'amount' => array( | |
291 | 'name' => 'amount', | |
292 | 'type' => CRM_Utils_Type::T_STRING, | |
293 | 'title' => ts('Amount') , | |
294 | 'description' => 'Price field option amount', | |
295 | 'required' => true, | |
296 | 'maxlength' => 512, | |
297 | 'size' => 8, | |
298 | 'html' => array( | |
299 | 'type' => 'Text', | |
300 | ) , | |
301 | ) , | |
302 | 'count' => array( | |
303 | 'name' => 'count', | |
304 | 'type' => CRM_Utils_Type::T_INT, | |
305 | 'title' => ts('Count') , | |
306 | 'description' => 'Number of participants per field option', | |
307 | 'default' => 'NULL', | |
308 | 'html' => array( | |
309 | 'type' => 'Text', | |
310 | ) , | |
311 | ) , | |
312 | 'max_value' => array( | |
313 | 'name' => 'max_value', | |
314 | 'type' => CRM_Utils_Type::T_INT, | |
315 | 'title' => ts('Max Value') , | |
316 | 'description' => 'Max number of participants per field options', | |
317 | 'default' => 'NULL', | |
318 | 'html' => array( | |
319 | 'type' => 'Text', | |
320 | ) , | |
321 | ) , | |
322 | 'weight' => array( | |
323 | 'name' => 'weight', | |
324 | 'type' => CRM_Utils_Type::T_INT, | |
325 | 'title' => ts('Order') , | |
326 | 'description' => 'Order in which the field options should appear', | |
327 | 'default' => '1', | |
328 | 'html' => array( | |
329 | 'type' => 'Text', | |
330 | ) , | |
331 | ) , | |
332 | 'membership_type_id' => array( | |
333 | 'name' => 'membership_type_id', | |
334 | 'type' => CRM_Utils_Type::T_INT, | |
335 | 'title' => ts('Membership Type') , | |
336 | 'description' => 'FK to Membership Type', | |
337 | 'default' => 'NULL', | |
338 | 'FKClassName' => 'CRM_Member_DAO_MembershipType', | |
339 | 'html' => array( | |
340 | 'type' => 'Select', | |
341 | ) , | |
342 | ) , | |
343 | 'membership_num_terms' => array( | |
344 | 'name' => 'membership_num_terms', | |
345 | 'type' => CRM_Utils_Type::T_INT, | |
346 | 'title' => ts('Membership Num Terms') , | |
347 | 'description' => 'Number of terms for this membership', | |
348 | 'default' => 'NULL', | |
349 | 'html' => array( | |
350 | 'type' => 'Text', | |
351 | ) , | |
352 | ) , | |
353 | 'is_default' => array( | |
354 | 'name' => 'is_default', | |
355 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
356 | 'title' => ts('Is Default Price Field Option?') , | |
357 | 'description' => 'Is this default price field option', | |
358 | 'html' => array( | |
359 | 'type' => 'CheckBox', | |
360 | ) , | |
361 | ) , | |
362 | 'is_active' => array( | |
363 | 'name' => 'is_active', | |
364 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
365 | 'title' => ts('Price Field Value is Active') , | |
366 | 'description' => 'Is this price field value active', | |
367 | 'default' => '1', | |
368 | ) , | |
369 | 'financial_type_id' => array( | |
370 | 'name' => 'financial_type_id', | |
371 | 'type' => CRM_Utils_Type::T_INT, | |
372 | 'title' => ts('Financial Type') , | |
373 | 'description' => 'FK to Financial Type.', | |
374 | 'default' => 'NULL', | |
375 | 'FKClassName' => 'CRM_Financial_DAO_FinancialType', | |
376 | 'html' => array( | |
377 | 'type' => 'Select', | |
378 | ) , | |
379 | 'pseudoconstant' => array( | |
380 | 'table' => 'civicrm_financial_type', | |
381 | 'keyColumn' => 'id', | |
382 | 'labelColumn' => 'name', | |
383 | ) | |
384 | ) , | |
385 | 'deductible_amount' => array( | |
386 | 'name' => 'deductible_amount', | |
387 | 'type' => CRM_Utils_Type::T_MONEY, | |
388 | 'title' => ts('Deductible Amount') , | |
389 | 'description' => 'Tax-deductible portion of the amount', | |
390 | 'required' => true, | |
391 | 'precision' => array( | |
392 | 20, | |
393 | 2 | |
394 | ) , | |
395 | 'default' => '0.0', | |
396 | 'html' => array( | |
397 | 'type' => 'Text', | |
398 | ) , | |
399 | ) , | |
400 | ); | |
401 | } | |
402 | return self::$_fields; | |
403 | } | |
404 | /** | |
405 | * Returns an array containing, for each field, the arary key used for that | |
406 | * field in self::$_fields. | |
407 | * | |
408 | * @return array | |
409 | */ | |
410 | static function &fieldKeys() { | |
411 | if (!(self::$_fieldKeys)) { | |
412 | self::$_fieldKeys = array( | |
413 | 'id' => 'id', | |
414 | 'price_field_id' => 'price_field_id', | |
415 | 'name' => 'name', | |
416 | 'label' => 'label', | |
417 | 'description' => 'description', | |
418 | 'help_pre' => 'help_pre', | |
419 | 'help_post' => 'help_post', | |
420 | 'amount' => 'amount', | |
421 | 'count' => 'count', | |
422 | 'max_value' => 'max_value', | |
423 | 'weight' => 'weight', | |
424 | 'membership_type_id' => 'membership_type_id', | |
425 | 'membership_num_terms' => 'membership_num_terms', | |
426 | 'is_default' => 'is_default', | |
427 | 'is_active' => 'is_active', | |
428 | 'financial_type_id' => 'financial_type_id', | |
429 | 'deductible_amount' => 'deductible_amount', | |
430 | ); | |
431 | } | |
432 | return self::$_fieldKeys; | |
433 | } | |
434 | /** | |
435 | * Returns the names of this table | |
436 | * | |
437 | * @return string | |
438 | */ | |
439 | static function getTableName() { | |
440 | return CRM_Core_DAO::getLocaleTableName(self::$_tableName); | |
441 | } | |
442 | /** | |
443 | * Returns if this table needs to be logged | |
444 | * | |
445 | * @return boolean | |
446 | */ | |
447 | function getLog() { | |
448 | return self::$_log; | |
449 | } | |
450 | /** | |
451 | * Returns the list of fields that can be imported | |
452 | * | |
453 | * @param bool $prefix | |
454 | * | |
455 | * @return array | |
456 | */ | |
457 | static function &import($prefix = false) { | |
458 | if (!(self::$_import)) { | |
459 | self::$_import = array(); | |
460 | $fields = self::fields(); | |
461 | foreach($fields as $name => $field) { | |
462 | if (CRM_Utils_Array::value('import', $field)) { | |
463 | if ($prefix) { | |
464 | self::$_import['price_field_value'] = & $fields[$name]; | |
465 | } else { | |
466 | self::$_import[$name] = & $fields[$name]; | |
467 | } | |
468 | } | |
469 | } | |
470 | } | |
471 | return self::$_import; | |
472 | } | |
473 | /** | |
474 | * Returns the list of fields that can be exported | |
475 | * | |
476 | * @param bool $prefix | |
477 | * | |
478 | * @return array | |
479 | */ | |
480 | static function &export($prefix = false) { | |
481 | if (!(self::$_export)) { | |
482 | self::$_export = array(); | |
483 | $fields = self::fields(); | |
484 | foreach($fields as $name => $field) { | |
485 | if (CRM_Utils_Array::value('export', $field)) { | |
486 | if ($prefix) { | |
487 | self::$_export['price_field_value'] = & $fields[$name]; | |
488 | } else { | |
489 | self::$_export[$name] = & $fields[$name]; | |
490 | } | |
491 | } | |
492 | } | |
493 | } | |
494 | return self::$_export; | |
495 | } | |
496 | } |