Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
ca5cec67 | 5 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Price/PriceFieldValue.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
2cbbebe8 | 9 | * (GenCodeChecksum:dfd666e126f31f5c1f5f9c7c47050d4f) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the PriceFieldValue entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Price_DAO_PriceFieldValue extends CRM_Core_DAO { |
929a1c14 CW |
16 | const EXT = 'civicrm'; |
17 | const TABLE_ADDED = '3.3'; | |
d31fb4e3 | 18 | const COMPONENT = 'CiviContribute'; |
c3fc2621 | 19 | |
e501603b | 20 | /** |
f41f0342 | 21 | * Static instance to hold the table name. |
e501603b TO |
22 | * |
23 | * @var string | |
24 | */ | |
fa45b5b9 | 25 | public static $_tableName = 'civicrm_price_field_value'; |
c3fc2621 | 26 | |
e501603b | 27 | /** |
f41f0342 | 28 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 29 | * |
c3fc2621 | 30 | * @var bool |
e501603b | 31 | */ |
fa45b5b9 | 32 | public static $_log = FALSE; |
c3fc2621 | 33 | |
e501603b TO |
34 | /** |
35 | * Price Field Value | |
36 | * | |
e6ca0a57 | 37 | * @var int |
e501603b TO |
38 | */ |
39 | public $id; | |
c3fc2621 | 40 | |
e501603b TO |
41 | /** |
42 | * FK to civicrm_price_field | |
43 | * | |
e6ca0a57 | 44 | * @var int |
e501603b TO |
45 | */ |
46 | public $price_field_id; | |
c3fc2621 | 47 | |
e501603b TO |
48 | /** |
49 | * Price field option name | |
50 | * | |
51 | * @var string | |
52 | */ | |
53 | public $name; | |
c3fc2621 | 54 | |
e501603b TO |
55 | /** |
56 | * Price field option label | |
57 | * | |
58 | * @var string | |
59 | */ | |
60 | public $label; | |
c3fc2621 | 61 | |
e501603b | 62 | /** |
f95ab9d4 | 63 | * Price field option description. |
e501603b TO |
64 | * |
65 | * @var text | |
66 | */ | |
67 | public $description; | |
c3fc2621 | 68 | |
e501603b TO |
69 | /** |
70 | * Price field option pre help text. | |
71 | * | |
72 | * @var text | |
73 | */ | |
74 | public $help_pre; | |
c3fc2621 | 75 | |
e501603b TO |
76 | /** |
77 | * Price field option post field help. | |
78 | * | |
79 | * @var text | |
80 | */ | |
81 | public $help_post; | |
c3fc2621 | 82 | |
e501603b TO |
83 | /** |
84 | * Price field option amount | |
85 | * | |
25e0f950 | 86 | * @var float |
e501603b TO |
87 | */ |
88 | public $amount; | |
c3fc2621 | 89 | |
e501603b TO |
90 | /** |
91 | * Number of participants per field option | |
92 | * | |
e6ca0a57 | 93 | * @var int |
e501603b TO |
94 | */ |
95 | public $count; | |
c3fc2621 | 96 | |
e501603b TO |
97 | /** |
98 | * Max number of participants per field options | |
99 | * | |
e6ca0a57 | 100 | * @var int |
e501603b TO |
101 | */ |
102 | public $max_value; | |
c3fc2621 | 103 | |
e501603b TO |
104 | /** |
105 | * Order in which the field options should appear | |
106 | * | |
107 | * @var int | |
108 | */ | |
109 | public $weight; | |
c3fc2621 | 110 | |
e501603b TO |
111 | /** |
112 | * FK to Membership Type | |
113 | * | |
e6ca0a57 | 114 | * @var int |
e501603b TO |
115 | */ |
116 | public $membership_type_id; | |
c3fc2621 | 117 | |
e501603b TO |
118 | /** |
119 | * Number of terms for this membership | |
120 | * | |
e6ca0a57 | 121 | * @var int |
e501603b TO |
122 | */ |
123 | public $membership_num_terms; | |
c3fc2621 | 124 | |
e501603b TO |
125 | /** |
126 | * Is this default price field option | |
127 | * | |
e6ca0a57 | 128 | * @var bool |
e501603b TO |
129 | */ |
130 | public $is_default; | |
c3fc2621 | 131 | |
e501603b TO |
132 | /** |
133 | * Is this price field value active | |
134 | * | |
e6ca0a57 | 135 | * @var bool |
e501603b TO |
136 | */ |
137 | public $is_active; | |
c3fc2621 | 138 | |
e501603b TO |
139 | /** |
140 | * FK to Financial Type. | |
141 | * | |
e6ca0a57 | 142 | * @var int |
e501603b TO |
143 | */ |
144 | public $financial_type_id; | |
c3fc2621 | 145 | |
e501603b | 146 | /** |
5afce5ad | 147 | * Portion of total amount which is NOT tax deductible. |
e501603b TO |
148 | * |
149 | * @var float | |
150 | */ | |
5afce5ad | 151 | public $non_deductible_amount; |
c3fc2621 | 152 | |
2db35bf6 | 153 | /** |
64ca7bcd | 154 | * Implicit FK to civicrm_option_group with name = 'visibility' |
2db35bf6 | 155 | * |
e6ca0a57 | 156 | * @var int |
2db35bf6 AF |
157 | */ |
158 | public $visibility_id; | |
c3fc2621 | 159 | |
e501603b | 160 | /** |
f41f0342 | 161 | * Class constructor. |
e501603b | 162 | */ |
c3fc2621 | 163 | public function __construct() { |
e501603b TO |
164 | $this->__table = 'civicrm_price_field_value'; |
165 | parent::__construct(); | |
166 | } | |
c3fc2621 | 167 | |
449c4e6b CW |
168 | /** |
169 | * Returns localized title of this entity. | |
7b66c3b5 AH |
170 | * |
171 | * @param bool $plural | |
172 | * Whether to return the plural version of the title. | |
449c4e6b | 173 | */ |
7b66c3b5 AH |
174 | public static function getEntityTitle($plural = FALSE) { |
175 | return $plural ? ts('Price Field Values') : ts('Price Field Value'); | |
449c4e6b CW |
176 | } |
177 | ||
e501603b | 178 | /** |
f41f0342 | 179 | * Returns foreign keys and entity references. |
e501603b TO |
180 | * |
181 | * @return array | |
182 | * [CRM_Core_Reference_Interface] | |
183 | */ | |
c3fc2621 | 184 | public static function getReferenceColumns() { |
346aaaba | 185 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
fa45b5b9 | 186 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 CW |
187 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'price_field_id', 'civicrm_price_field', 'id'); |
188 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'membership_type_id', 'civicrm_membership_type', 'id'); | |
189 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'financial_type_id', 'civicrm_financial_type', 'id'); | |
346aaaba | 190 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 191 | } |
346aaaba | 192 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 193 | } |
c3fc2621 | 194 | |
e501603b TO |
195 | /** |
196 | * Returns all the column names of this table | |
197 | * | |
198 | * @return array | |
199 | */ | |
c3fc2621 | 200 | public static function &fields() { |
346aaaba | 201 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
202 | Civi::$statics[__CLASS__]['fields'] = [ |
203 | 'id' => [ | |
e501603b TO |
204 | 'name' => 'id', |
205 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 206 | 'title' => ts('Price Field Value ID'), |
215b423e | 207 | 'description' => ts('Price Field Value'), |
c3fc2621 | 208 | 'required' => TRUE, |
a36434b9 | 209 | 'where' => 'civicrm_price_field_value.id', |
522a26c9 | 210 | 'table_name' => 'civicrm_price_field_value', |
211 | 'entity' => 'PriceFieldValue', | |
212 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 213 | 'localizable' => 0, |
2cbbebe8 A |
214 | 'html' => [ |
215 | 'type' => 'Number', | |
216 | ], | |
a9d0587b | 217 | 'add' => '3.3', |
c3fc2621 CW |
218 | ], |
219 | 'price_field_id' => [ | |
e501603b TO |
220 | 'name' => 'price_field_id', |
221 | 'type' => CRM_Utils_Type::T_INT, | |
2cbbebe8 | 222 | 'title' => ts('Price Field ID'), |
215b423e | 223 | 'description' => ts('FK to civicrm_price_field'), |
c3fc2621 | 224 | 'required' => TRUE, |
a36434b9 | 225 | 'where' => 'civicrm_price_field_value.price_field_id', |
522a26c9 | 226 | 'table_name' => 'civicrm_price_field_value', |
227 | 'entity' => 'PriceFieldValue', | |
228 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 229 | 'localizable' => 0, |
e501603b | 230 | 'FKClassName' => 'CRM_Price_DAO_PriceField', |
2cbbebe8 A |
231 | 'html' => [ |
232 | 'label' => ts("Price Field"), | |
233 | ], | |
a9d0587b | 234 | 'add' => '3.3', |
c3fc2621 CW |
235 | ], |
236 | 'name' => [ | |
e501603b TO |
237 | 'name' => 'name', |
238 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 239 | 'title' => ts('Name'), |
215b423e | 240 | 'description' => ts('Price field option name'), |
e501603b TO |
241 | 'maxlength' => 255, |
242 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 243 | 'where' => 'civicrm_price_field_value.name', |
7154c2c0 | 244 | 'default' => 'NULL', |
522a26c9 | 245 | 'table_name' => 'civicrm_price_field_value', |
246 | 'entity' => 'PriceFieldValue', | |
247 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 248 | 'localizable' => 0, |
c3fc2621 | 249 | 'html' => [ |
e501603b | 250 | 'type' => 'Text', |
c3fc2621 | 251 | ], |
a9d0587b | 252 | 'add' => '3.3', |
c3fc2621 CW |
253 | ], |
254 | 'label' => [ | |
e501603b TO |
255 | 'name' => 'label', |
256 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 257 | 'title' => ts('Label'), |
215b423e | 258 | 'description' => ts('Price field option label'), |
e501603b TO |
259 | 'maxlength' => 255, |
260 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 261 | 'where' => 'civicrm_price_field_value.label', |
7154c2c0 | 262 | 'default' => 'NULL', |
522a26c9 | 263 | 'table_name' => 'civicrm_price_field_value', |
264 | 'entity' => 'PriceFieldValue', | |
265 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 266 | 'localizable' => 1, |
c3fc2621 | 267 | 'html' => [ |
e501603b | 268 | 'type' => 'Text', |
c3fc2621 | 269 | ], |
a9d0587b | 270 | 'add' => '3.3', |
c3fc2621 CW |
271 | ], |
272 | 'description' => [ | |
e501603b TO |
273 | 'name' => 'description', |
274 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 275 | 'title' => ts('Description'), |
f95ab9d4 | 276 | 'description' => ts('Price field option description.'), |
e501603b TO |
277 | 'rows' => 2, |
278 | 'cols' => 60, | |
a36434b9 | 279 | 'where' => 'civicrm_price_field_value.description', |
e501603b | 280 | 'default' => 'NULL', |
522a26c9 | 281 | 'table_name' => 'civicrm_price_field_value', |
282 | 'entity' => 'PriceFieldValue', | |
283 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 284 | 'localizable' => 1, |
c3fc2621 | 285 | 'html' => [ |
e501603b | 286 | 'type' => 'TextArea', |
c3fc2621 | 287 | ], |
a9d0587b | 288 | 'add' => '3.3', |
c3fc2621 CW |
289 | ], |
290 | 'help_pre' => [ | |
e501603b TO |
291 | 'name' => 'help_pre', |
292 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 293 | 'title' => ts('Help Pre'), |
215b423e | 294 | 'description' => ts('Price field option pre help text.'), |
e501603b TO |
295 | 'rows' => 2, |
296 | 'cols' => 60, | |
a36434b9 | 297 | 'where' => 'civicrm_price_field_value.help_pre', |
e501603b | 298 | 'default' => 'NULL', |
522a26c9 | 299 | 'table_name' => 'civicrm_price_field_value', |
300 | 'entity' => 'PriceFieldValue', | |
301 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 302 | 'localizable' => 1, |
c3fc2621 | 303 | 'html' => [ |
e501603b | 304 | 'type' => 'TextArea', |
c3fc2621 | 305 | ], |
a9d0587b | 306 | 'add' => '4.7', |
c3fc2621 CW |
307 | ], |
308 | 'help_post' => [ | |
e501603b TO |
309 | 'name' => 'help_post', |
310 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 311 | 'title' => ts('Help Post'), |
215b423e | 312 | 'description' => ts('Price field option post field help.'), |
e501603b TO |
313 | 'rows' => 2, |
314 | 'cols' => 60, | |
a36434b9 | 315 | 'where' => 'civicrm_price_field_value.help_post', |
e501603b | 316 | 'default' => 'NULL', |
522a26c9 | 317 | 'table_name' => 'civicrm_price_field_value', |
318 | 'entity' => 'PriceFieldValue', | |
319 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 320 | 'localizable' => 1, |
c3fc2621 | 321 | 'html' => [ |
e501603b | 322 | 'type' => 'TextArea', |
c3fc2621 | 323 | ], |
a9d0587b | 324 | 'add' => '4.7', |
c3fc2621 CW |
325 | ], |
326 | 'amount' => [ | |
e501603b | 327 | 'name' => 'amount', |
25e0f950 | 328 | 'type' => CRM_Utils_Type::T_MONEY, |
c3fc2621 | 329 | 'title' => ts('Amount'), |
215b423e | 330 | 'description' => ts('Price field option amount'), |
c3fc2621 CW |
331 | 'required' => TRUE, |
332 | 'precision' => [ | |
25e0f950 | 333 | 18, |
fb607354 | 334 | 9, |
c3fc2621 | 335 | ], |
a36434b9 | 336 | 'where' => 'civicrm_price_field_value.amount', |
522a26c9 | 337 | 'table_name' => 'civicrm_price_field_value', |
338 | 'entity' => 'PriceFieldValue', | |
339 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 340 | 'localizable' => 0, |
c3fc2621 | 341 | 'html' => [ |
e501603b | 342 | 'type' => 'Text', |
c3fc2621 | 343 | ], |
a9d0587b | 344 | 'add' => '3.3', |
c3fc2621 CW |
345 | ], |
346 | 'count' => [ | |
e501603b TO |
347 | 'name' => 'count', |
348 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 349 | 'title' => ts('Count'), |
215b423e | 350 | 'description' => ts('Number of participants per field option'), |
a36434b9 | 351 | 'where' => 'civicrm_price_field_value.count', |
e501603b | 352 | 'default' => 'NULL', |
522a26c9 | 353 | 'table_name' => 'civicrm_price_field_value', |
354 | 'entity' => 'PriceFieldValue', | |
355 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 356 | 'localizable' => 0, |
c3fc2621 | 357 | 'html' => [ |
e501603b | 358 | 'type' => 'Text', |
c3fc2621 | 359 | ], |
a9d0587b | 360 | 'add' => '3.3', |
c3fc2621 CW |
361 | ], |
362 | 'max_value' => [ | |
e501603b TO |
363 | 'name' => 'max_value', |
364 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 365 | 'title' => ts('Max Value'), |
215b423e | 366 | 'description' => ts('Max number of participants per field options'), |
a36434b9 | 367 | 'where' => 'civicrm_price_field_value.max_value', |
e501603b | 368 | 'default' => 'NULL', |
522a26c9 | 369 | 'table_name' => 'civicrm_price_field_value', |
370 | 'entity' => 'PriceFieldValue', | |
371 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 372 | 'localizable' => 0, |
c3fc2621 | 373 | 'html' => [ |
e501603b | 374 | 'type' => 'Text', |
c3fc2621 | 375 | ], |
a9d0587b | 376 | 'add' => '3.3', |
c3fc2621 CW |
377 | ], |
378 | 'weight' => [ | |
e501603b TO |
379 | 'name' => 'weight', |
380 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 381 | 'title' => ts('Order'), |
215b423e | 382 | 'description' => ts('Order in which the field options should appear'), |
a36434b9 | 383 | 'where' => 'civicrm_price_field_value.weight', |
e501603b | 384 | 'default' => '1', |
522a26c9 | 385 | 'table_name' => 'civicrm_price_field_value', |
386 | 'entity' => 'PriceFieldValue', | |
387 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 388 | 'localizable' => 0, |
c3fc2621 | 389 | 'html' => [ |
e501603b | 390 | 'type' => 'Text', |
c3fc2621 | 391 | ], |
a9d0587b | 392 | 'add' => '3.3', |
c3fc2621 CW |
393 | ], |
394 | 'membership_type_id' => [ | |
e501603b TO |
395 | 'name' => 'membership_type_id', |
396 | 'type' => CRM_Utils_Type::T_INT, | |
2cbbebe8 | 397 | 'title' => ts('Membership Type ID'), |
215b423e | 398 | 'description' => ts('FK to Membership Type'), |
a36434b9 | 399 | 'where' => 'civicrm_price_field_value.membership_type_id', |
e501603b | 400 | 'default' => 'NULL', |
522a26c9 | 401 | 'table_name' => 'civicrm_price_field_value', |
402 | 'entity' => 'PriceFieldValue', | |
403 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 404 | 'localizable' => 0, |
e501603b | 405 | 'FKClassName' => 'CRM_Member_DAO_MembershipType', |
c3fc2621 | 406 | 'html' => [ |
e501603b | 407 | 'type' => 'Select', |
2cbbebe8 | 408 | 'label' => ts("Membership Type"), |
c3fc2621 | 409 | ], |
a9d0587b | 410 | 'add' => '3.4', |
c3fc2621 CW |
411 | ], |
412 | 'membership_num_terms' => [ | |
e501603b TO |
413 | 'name' => 'membership_num_terms', |
414 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 415 | 'title' => ts('Membership Num Terms'), |
215b423e | 416 | 'description' => ts('Number of terms for this membership'), |
a36434b9 | 417 | 'where' => 'civicrm_price_field_value.membership_num_terms', |
e501603b | 418 | 'default' => 'NULL', |
522a26c9 | 419 | 'table_name' => 'civicrm_price_field_value', |
420 | 'entity' => 'PriceFieldValue', | |
421 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 422 | 'localizable' => 0, |
c3fc2621 | 423 | 'html' => [ |
e501603b | 424 | 'type' => 'Text', |
c3fc2621 | 425 | ], |
a9d0587b | 426 | 'add' => '4.3', |
c3fc2621 CW |
427 | ], |
428 | 'is_default' => [ | |
e501603b TO |
429 | 'name' => 'is_default', |
430 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 431 | 'title' => ts('Is Default Price Field Option?'), |
215b423e | 432 | 'description' => ts('Is this default price field option'), |
a36434b9 | 433 | 'where' => 'civicrm_price_field_value.is_default', |
45a83e42 | 434 | 'default' => '0', |
522a26c9 | 435 | 'table_name' => 'civicrm_price_field_value', |
436 | 'entity' => 'PriceFieldValue', | |
437 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 438 | 'localizable' => 0, |
c3fc2621 | 439 | 'html' => [ |
e501603b | 440 | 'type' => 'CheckBox', |
c3fc2621 | 441 | ], |
a9d0587b | 442 | 'add' => '3.3', |
c3fc2621 CW |
443 | ], |
444 | 'is_active' => [ | |
e501603b TO |
445 | 'name' => 'is_active', |
446 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 447 | 'title' => ts('Price Field Value is Active'), |
215b423e | 448 | 'description' => ts('Is this price field value active'), |
a36434b9 | 449 | 'where' => 'civicrm_price_field_value.is_active', |
e501603b | 450 | 'default' => '1', |
522a26c9 | 451 | 'table_name' => 'civicrm_price_field_value', |
452 | 'entity' => 'PriceFieldValue', | |
453 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 454 | 'localizable' => 0, |
a9d0587b | 455 | 'add' => '3.3', |
c3fc2621 CW |
456 | ], |
457 | 'financial_type_id' => [ | |
e501603b TO |
458 | 'name' => 'financial_type_id', |
459 | 'type' => CRM_Utils_Type::T_INT, | |
2cbbebe8 | 460 | 'title' => ts('Financial Type ID'), |
215b423e | 461 | 'description' => ts('FK to Financial Type.'), |
a36434b9 | 462 | 'where' => 'civicrm_price_field_value.financial_type_id', |
e501603b | 463 | 'default' => 'NULL', |
522a26c9 | 464 | 'table_name' => 'civicrm_price_field_value', |
465 | 'entity' => 'PriceFieldValue', | |
466 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 467 | 'localizable' => 0, |
e501603b | 468 | 'FKClassName' => 'CRM_Financial_DAO_FinancialType', |
c3fc2621 | 469 | 'html' => [ |
e501603b | 470 | 'type' => 'Select', |
2cbbebe8 | 471 | 'label' => ts("Financial Type"), |
c3fc2621 CW |
472 | ], |
473 | 'pseudoconstant' => [ | |
e501603b TO |
474 | 'table' => 'civicrm_financial_type', |
475 | 'keyColumn' => 'id', | |
476 | 'labelColumn' => 'name', | |
e6ca0a57 | 477 | ], |
a9d0587b | 478 | 'add' => '4.3', |
c3fc2621 CW |
479 | ], |
480 | 'non_deductible_amount' => [ | |
5afce5ad | 481 | 'name' => 'non_deductible_amount', |
e501603b | 482 | 'type' => CRM_Utils_Type::T_MONEY, |
c3fc2621 | 483 | 'title' => ts('Non-deductible Amount'), |
215b423e | 484 | 'description' => ts('Portion of total amount which is NOT tax deductible.'), |
c3fc2621 CW |
485 | 'required' => TRUE, |
486 | 'precision' => [ | |
e501603b | 487 | 20, |
fb607354 | 488 | 2, |
c3fc2621 | 489 | ], |
a36434b9 | 490 | 'where' => 'civicrm_price_field_value.non_deductible_amount', |
491 | 'headerPattern' => '/non?.?deduct/i', | |
492 | 'dataPattern' => '/^\d+(\.\d{2})?$/', | |
e501603b | 493 | 'default' => '0.0', |
522a26c9 | 494 | 'table_name' => 'civicrm_price_field_value', |
495 | 'entity' => 'PriceFieldValue', | |
496 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
6a7e5e5d | 497 | 'localizable' => 0, |
c3fc2621 | 498 | 'html' => [ |
e501603b | 499 | 'type' => 'Text', |
c3fc2621 | 500 | ], |
a9d0587b | 501 | 'add' => '4.7', |
c3fc2621 CW |
502 | ], |
503 | 'visibility_id' => [ | |
2db35bf6 AF |
504 | 'name' => 'visibility_id', |
505 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 506 | 'title' => ts('Price Field Option Visibility'), |
215b423e | 507 | 'description' => ts('Implicit FK to civicrm_option_group with name = \'visibility\''), |
a36434b9 | 508 | 'where' => 'civicrm_price_field_value.visibility_id', |
2db35bf6 AF |
509 | 'default' => '1', |
510 | 'table_name' => 'civicrm_price_field_value', | |
511 | 'entity' => 'PriceFieldValue', | |
512 | 'bao' => 'CRM_Price_BAO_PriceFieldValue', | |
513 | 'localizable' => 0, | |
c3fc2621 | 514 | 'html' => [ |
2db35bf6 | 515 | 'type' => 'Select', |
c3fc2621 CW |
516 | ], |
517 | 'pseudoconstant' => [ | |
2db35bf6 AF |
518 | 'optionGroupName' => 'visibility', |
519 | 'optionEditPath' => 'civicrm/admin/options/visibility', | |
e6ca0a57 | 520 | ], |
a9d0587b | 521 | 'add' => '4.7', |
c3fc2621 CW |
522 | ], |
523 | ]; | |
346aaaba | 524 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 525 | } |
346aaaba | 526 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 527 | } |
c3fc2621 | 528 | |
e501603b | 529 | /** |
bd8e0b14 | 530 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
531 | * |
532 | * @return array | |
bd8e0b14 | 533 | * Array(string $name => string $uniqueName). |
e501603b | 534 | */ |
c3fc2621 | 535 | public static function &fieldKeys() { |
bd8e0b14 TO |
536 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
537 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 538 | } |
bd8e0b14 | 539 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 540 | } |
c3fc2621 | 541 | |
e501603b TO |
542 | /** |
543 | * Returns the names of this table | |
544 | * | |
545 | * @return string | |
546 | */ | |
c3fc2621 | 547 | public static function getTableName() { |
e501603b TO |
548 | return CRM_Core_DAO::getLocaleTableName(self::$_tableName); |
549 | } | |
c3fc2621 | 550 | |
e501603b TO |
551 | /** |
552 | * Returns if this table needs to be logged | |
553 | * | |
c3fc2621 | 554 | * @return bool |
e501603b | 555 | */ |
c3fc2621 | 556 | public function getLog() { |
e501603b TO |
557 | return self::$_log; |
558 | } | |
c3fc2621 | 559 | |
e501603b TO |
560 | /** |
561 | * Returns the list of fields that can be imported | |
562 | * | |
563 | * @param bool $prefix | |
564 | * | |
565 | * @return array | |
566 | */ | |
c3fc2621 CW |
567 | public static function &import($prefix = FALSE) { |
568 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'price_field_value', $prefix, []); | |
60808919 | 569 | return $r; |
e501603b | 570 | } |
c3fc2621 | 571 | |
e501603b TO |
572 | /** |
573 | * Returns the list of fields that can be exported | |
574 | * | |
575 | * @param bool $prefix | |
576 | * | |
577 | * @return array | |
578 | */ | |
c3fc2621 CW |
579 | public static function &export($prefix = FALSE) { |
580 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'price_field_value', $prefix, []); | |
60808919 | 581 | return $r; |
e501603b | 582 | } |
c3fc2621 | 583 | |
e7a6b91a AS |
584 | /** |
585 | * Returns the list of indices | |
c3fc2621 CW |
586 | * |
587 | * @param bool $localize | |
588 | * | |
589 | * @return array | |
e7a6b91a AS |
590 | */ |
591 | public static function indices($localize = TRUE) { | |
c3fc2621 | 592 | $indices = []; |
e7a6b91a AS |
593 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
594 | } | |
c3fc2621 | 595 | |
e501603b | 596 | } |