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