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/PriceField.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
28979d65 | 9 | * (GenCodeChecksum:e8aa16285c520e7ce5288da53397f9df) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the PriceField entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Price_DAO_PriceField extends CRM_Core_DAO { |
929a1c14 CW |
16 | const EXT = 'civicrm'; |
17 | const TABLE_ADDED = '1.8'; | |
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'; |
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 = TRUE; |
c3fc2621 | 33 | |
e501603b TO |
34 | /** |
35 | * Price Field | |
36 | * | |
28979d65 CW |
37 | * @var int|string|null |
38 | * (SQL type: int unsigned) | |
39 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
40 | */ |
41 | public $id; | |
c3fc2621 | 42 | |
e501603b TO |
43 | /** |
44 | * FK to civicrm_price_set | |
45 | * | |
28979d65 CW |
46 | * @var int|string |
47 | * (SQL type: int unsigned) | |
48 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
49 | */ |
50 | public $price_set_id; | |
c3fc2621 | 51 | |
e501603b TO |
52 | /** |
53 | * Variable name/programmatic handle for this field. | |
54 | * | |
55 | * @var string | |
28979d65 CW |
56 | * (SQL type: varchar(255)) |
57 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
58 | */ |
59 | public $name; | |
c3fc2621 | 60 | |
e501603b TO |
61 | /** |
62 | * Text for form field label (also friendly name for administering this field). | |
63 | * | |
64 | * @var string | |
28979d65 CW |
65 | * (SQL type: varchar(255)) |
66 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
67 | */ |
68 | public $label; | |
c3fc2621 | 69 | |
e501603b | 70 | /** |
e501603b | 71 | * @var string |
28979d65 CW |
72 | * (SQL type: varchar(12)) |
73 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
74 | */ |
75 | public $html_type; | |
c3fc2621 | 76 | |
e501603b TO |
77 | /** |
78 | * Enter a quantity for this field? | |
79 | * | |
28979d65 CW |
80 | * @var bool|string|null |
81 | * (SQL type: tinyint) | |
82 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
83 | */ |
84 | public $is_enter_qty; | |
c3fc2621 | 85 | |
e501603b TO |
86 | /** |
87 | * Description and/or help text to display before this field. | |
88 | * | |
28979d65 CW |
89 | * @var string|null |
90 | * (SQL type: text) | |
91 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
92 | */ |
93 | public $help_pre; | |
c3fc2621 | 94 | |
e501603b TO |
95 | /** |
96 | * Description and/or help text to display after this field. | |
97 | * | |
28979d65 CW |
98 | * @var string|null |
99 | * (SQL type: text) | |
100 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
101 | */ |
102 | public $help_post; | |
c3fc2621 | 103 | |
e501603b TO |
104 | /** |
105 | * Order in which the fields should appear | |
106 | * | |
28979d65 CW |
107 | * @var int|string|null |
108 | * (SQL type: int) | |
109 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
110 | */ |
111 | public $weight; | |
c3fc2621 | 112 | |
e501603b TO |
113 | /** |
114 | * Should the price be displayed next to the label for each option? | |
115 | * | |
28979d65 CW |
116 | * @var bool|string|null |
117 | * (SQL type: tinyint) | |
118 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
119 | */ |
120 | public $is_display_amounts; | |
c3fc2621 | 121 | |
e501603b TO |
122 | /** |
123 | * number of options per line for checkbox and radio | |
124 | * | |
28979d65 CW |
125 | * @var int|string|null |
126 | * (SQL type: int unsigned) | |
127 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
128 | */ |
129 | public $options_per_line; | |
c3fc2621 | 130 | |
e501603b TO |
131 | /** |
132 | * Is this price field active | |
133 | * | |
28979d65 CW |
134 | * @var bool|string|null |
135 | * (SQL type: tinyint) | |
136 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
137 | */ |
138 | public $is_active; | |
c3fc2621 | 139 | |
e501603b TO |
140 | /** |
141 | * Is this price field required (value must be > 1) | |
142 | * | |
28979d65 CW |
143 | * @var bool|string|null |
144 | * (SQL type: tinyint) | |
145 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
146 | */ |
147 | public $is_required; | |
c3fc2621 | 148 | |
e501603b TO |
149 | /** |
150 | * If non-zero, do not show this field before the date specified | |
151 | * | |
28979d65 CW |
152 | * @var string|null |
153 | * (SQL type: datetime) | |
154 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
155 | */ |
156 | public $active_on; | |
c3fc2621 | 157 | |
e501603b TO |
158 | /** |
159 | * If non-zero, do not show this field after the date specified | |
160 | * | |
28979d65 CW |
161 | * @var string|null |
162 | * (SQL type: datetime) | |
163 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
164 | */ |
165 | public $expire_on; | |
c3fc2621 | 166 | |
e501603b TO |
167 | /** |
168 | * Optional scripting attributes for field | |
169 | * | |
28979d65 CW |
170 | * @var string|null |
171 | * (SQL type: varchar(255)) | |
172 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
173 | */ |
174 | public $javascript; | |
c3fc2621 | 175 | |
e501603b TO |
176 | /** |
177 | * Implicit FK to civicrm_option_group with name = 'visibility' | |
178 | * | |
28979d65 CW |
179 | * @var int|string|null |
180 | * (SQL type: int unsigned) | |
181 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
182 | */ |
183 | public $visibility_id; | |
c3fc2621 | 184 | |
e501603b | 185 | /** |
f41f0342 | 186 | * Class constructor. |
e501603b | 187 | */ |
c3fc2621 | 188 | public function __construct() { |
e501603b TO |
189 | $this->__table = 'civicrm_price_field'; |
190 | parent::__construct(); | |
191 | } | |
c3fc2621 | 192 | |
449c4e6b CW |
193 | /** |
194 | * Returns localized title of this entity. | |
7b66c3b5 AH |
195 | * |
196 | * @param bool $plural | |
197 | * Whether to return the plural version of the title. | |
449c4e6b | 198 | */ |
7b66c3b5 AH |
199 | public static function getEntityTitle($plural = FALSE) { |
200 | return $plural ? ts('Price Fields') : ts('Price Field'); | |
449c4e6b CW |
201 | } |
202 | ||
e501603b | 203 | /** |
f41f0342 | 204 | * Returns foreign keys and entity references. |
e501603b TO |
205 | * |
206 | * @return array | |
207 | * [CRM_Core_Reference_Interface] | |
208 | */ | |
c3fc2621 | 209 | public static function getReferenceColumns() { |
346aaaba | 210 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
fa45b5b9 | 211 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 | 212 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'price_set_id', 'civicrm_price_set', 'id'); |
346aaaba | 213 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 214 | } |
346aaaba | 215 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 216 | } |
c3fc2621 | 217 | |
e501603b TO |
218 | /** |
219 | * Returns all the column names of this table | |
220 | * | |
221 | * @return array | |
222 | */ | |
c3fc2621 | 223 | public static function &fields() { |
346aaaba | 224 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
225 | Civi::$statics[__CLASS__]['fields'] = [ |
226 | 'id' => [ | |
e501603b TO |
227 | 'name' => 'id', |
228 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 229 | 'title' => ts('Price Field ID'), |
215b423e | 230 | 'description' => ts('Price Field'), |
c3fc2621 | 231 | 'required' => TRUE, |
a36434b9 | 232 | 'where' => 'civicrm_price_field.id', |
522a26c9 | 233 | 'table_name' => 'civicrm_price_field', |
234 | 'entity' => 'PriceField', | |
235 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 236 | 'localizable' => 0, |
2cbbebe8 A |
237 | 'html' => [ |
238 | 'type' => 'Number', | |
239 | ], | |
1fe423d6 | 240 | 'readonly' => TRUE, |
a9d0587b | 241 | 'add' => '1.8', |
c3fc2621 CW |
242 | ], |
243 | 'price_set_id' => [ | |
e501603b TO |
244 | 'name' => 'price_set_id', |
245 | 'type' => CRM_Utils_Type::T_INT, | |
2cbbebe8 | 246 | 'title' => ts('Price Set ID'), |
215b423e | 247 | 'description' => ts('FK to civicrm_price_set'), |
c3fc2621 | 248 | 'required' => TRUE, |
a36434b9 | 249 | 'where' => 'civicrm_price_field.price_set_id', |
522a26c9 | 250 | 'table_name' => 'civicrm_price_field', |
251 | 'entity' => 'PriceField', | |
252 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 253 | 'localizable' => 0, |
e501603b | 254 | 'FKClassName' => 'CRM_Price_DAO_PriceSet', |
2cbbebe8 | 255 | 'html' => [ |
833379ab | 256 | 'type' => 'Select', |
2cbbebe8 A |
257 | 'label' => ts("Price Set"), |
258 | ], | |
56616a73 PN |
259 | 'pseudoconstant' => [ |
260 | 'table' => 'civicrm_price_set', | |
261 | 'keyColumn' => 'id', | |
262 | 'labelColumn' => 'title', | |
4f238b49 | 263 | 'nameColumn' => 'name', |
56616a73 | 264 | ], |
a9d0587b | 265 | 'add' => '1.8', |
c3fc2621 CW |
266 | ], |
267 | 'name' => [ | |
e501603b TO |
268 | 'name' => 'name', |
269 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 270 | 'title' => ts('Name'), |
215b423e | 271 | 'description' => ts('Variable name/programmatic handle for this field.'), |
c3fc2621 | 272 | 'required' => TRUE, |
e501603b TO |
273 | 'maxlength' => 255, |
274 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 275 | 'where' => 'civicrm_price_field.name', |
522a26c9 | 276 | 'table_name' => 'civicrm_price_field', |
277 | 'entity' => 'PriceField', | |
278 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 279 | 'localizable' => 0, |
c3fc2621 | 280 | 'html' => [ |
e501603b | 281 | 'type' => 'Text', |
c3fc2621 | 282 | ], |
a9d0587b | 283 | 'add' => '1.8', |
c3fc2621 CW |
284 | ], |
285 | 'label' => [ | |
e501603b TO |
286 | 'name' => 'label', |
287 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 288 | 'title' => ts('Label'), |
215b423e | 289 | 'description' => ts('Text for form field label (also friendly name for administering this field).'), |
c3fc2621 | 290 | 'required' => TRUE, |
e501603b TO |
291 | 'maxlength' => 255, |
292 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 293 | 'where' => 'civicrm_price_field.label', |
522a26c9 | 294 | 'table_name' => 'civicrm_price_field', |
295 | 'entity' => 'PriceField', | |
296 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 297 | 'localizable' => 1, |
c3fc2621 | 298 | 'html' => [ |
e501603b | 299 | 'type' => 'Text', |
c3fc2621 | 300 | ], |
a9d0587b | 301 | 'add' => '1.8', |
c3fc2621 CW |
302 | ], |
303 | 'html_type' => [ | |
e501603b TO |
304 | 'name' => 'html_type', |
305 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 CW |
306 | 'title' => ts('Html Type'), |
307 | 'required' => TRUE, | |
e501603b TO |
308 | 'maxlength' => 12, |
309 | 'size' => CRM_Utils_Type::TWELVE, | |
a36434b9 | 310 | 'where' => 'civicrm_price_field.html_type', |
522a26c9 | 311 | 'table_name' => 'civicrm_price_field', |
312 | 'entity' => 'PriceField', | |
313 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 314 | 'localizable' => 0, |
c3fc2621 | 315 | 'html' => [ |
e501603b | 316 | 'type' => 'Select', |
c23563e3 | 317 | 'label' => ts("Html Type"), |
c3fc2621 CW |
318 | ], |
319 | 'pseudoconstant' => [ | |
e501603b | 320 | 'callback' => 'CRM_Price_BAO_PriceField::htmlTypes', |
e6ca0a57 | 321 | ], |
a9d0587b | 322 | 'add' => '1.8', |
c3fc2621 CW |
323 | ], |
324 | 'is_enter_qty' => [ | |
e501603b TO |
325 | 'name' => 'is_enter_qty', |
326 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 327 | 'title' => ts('Price Field Quantity Required?'), |
215b423e | 328 | 'description' => ts('Enter a quantity for this field?'), |
a36434b9 | 329 | 'where' => 'civicrm_price_field.is_enter_qty', |
45a83e42 | 330 | 'default' => '0', |
522a26c9 | 331 | 'table_name' => 'civicrm_price_field', |
332 | 'entity' => 'PriceField', | |
333 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 334 | 'localizable' => 0, |
c3fc2621 | 335 | 'html' => [ |
e501603b | 336 | 'type' => 'CheckBox', |
c3fc2621 | 337 | ], |
a9d0587b | 338 | 'add' => '1.8', |
c3fc2621 CW |
339 | ], |
340 | 'help_pre' => [ | |
e501603b TO |
341 | 'name' => 'help_pre', |
342 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 343 | 'title' => ts('Price Field Pre Text'), |
215b423e | 344 | 'description' => ts('Description and/or help text to display before this field.'), |
e501603b TO |
345 | 'rows' => 4, |
346 | 'cols' => 80, | |
a36434b9 | 347 | 'where' => 'civicrm_price_field.help_pre', |
522a26c9 | 348 | 'table_name' => 'civicrm_price_field', |
349 | 'entity' => 'PriceField', | |
350 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 351 | 'localizable' => 1, |
c3fc2621 | 352 | 'html' => [ |
e501603b | 353 | 'type' => 'TextArea', |
c3fc2621 | 354 | ], |
a9d0587b | 355 | 'add' => '1.8', |
c3fc2621 CW |
356 | ], |
357 | 'help_post' => [ | |
e501603b TO |
358 | 'name' => 'help_post', |
359 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 360 | 'title' => ts('Price Field Post Text'), |
215b423e | 361 | 'description' => ts('Description and/or help text to display after this field.'), |
e501603b TO |
362 | 'rows' => 4, |
363 | 'cols' => 80, | |
a36434b9 | 364 | 'where' => 'civicrm_price_field.help_post', |
522a26c9 | 365 | 'table_name' => 'civicrm_price_field', |
366 | 'entity' => 'PriceField', | |
367 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 368 | 'localizable' => 1, |
c3fc2621 | 369 | 'html' => [ |
e501603b | 370 | 'type' => 'TextArea', |
c3fc2621 | 371 | ], |
a9d0587b | 372 | 'add' => '1.8', |
c3fc2621 CW |
373 | ], |
374 | 'weight' => [ | |
e501603b TO |
375 | 'name' => 'weight', |
376 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 377 | 'title' => ts('Order'), |
215b423e | 378 | 'description' => ts('Order in which the fields should appear'), |
a36434b9 | 379 | 'where' => 'civicrm_price_field.weight', |
e501603b | 380 | 'default' => '1', |
522a26c9 | 381 | 'table_name' => 'civicrm_price_field', |
382 | 'entity' => 'PriceField', | |
383 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 384 | 'localizable' => 0, |
c3fc2621 | 385 | 'html' => [ |
e501603b | 386 | 'type' => 'Select', |
c3fc2621 | 387 | ], |
a9d0587b | 388 | 'add' => '1.8', |
c3fc2621 CW |
389 | ], |
390 | 'is_display_amounts' => [ | |
e501603b TO |
391 | 'name' => 'is_display_amounts', |
392 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 393 | 'title' => ts('Price Field Show Amounts?'), |
215b423e | 394 | 'description' => ts('Should the price be displayed next to the label for each option?'), |
a36434b9 | 395 | 'where' => 'civicrm_price_field.is_display_amounts', |
e501603b | 396 | 'default' => '1', |
522a26c9 | 397 | 'table_name' => 'civicrm_price_field', |
398 | 'entity' => 'PriceField', | |
399 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 400 | 'localizable' => 0, |
c3fc2621 | 401 | 'html' => [ |
e501603b | 402 | 'type' => 'CheckBox', |
c3fc2621 | 403 | ], |
a9d0587b | 404 | 'add' => NULL, |
c3fc2621 CW |
405 | ], |
406 | 'options_per_line' => [ | |
e501603b TO |
407 | 'name' => 'options_per_line', |
408 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 409 | 'title' => ts('Price Field Options per Row'), |
215b423e | 410 | 'description' => ts('number of options per line for checkbox and radio'), |
a36434b9 | 411 | 'where' => 'civicrm_price_field.options_per_line', |
e501603b | 412 | 'default' => '1', |
522a26c9 | 413 | 'table_name' => 'civicrm_price_field', |
414 | 'entity' => 'PriceField', | |
415 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 416 | 'localizable' => 0, |
c3fc2621 | 417 | 'html' => [ |
e501603b | 418 | 'type' => 'Text', |
c3fc2621 | 419 | ], |
a9d0587b | 420 | 'add' => '1.8', |
c3fc2621 CW |
421 | ], |
422 | 'is_active' => [ | |
e501603b TO |
423 | 'name' => 'is_active', |
424 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 425 | 'title' => ts('Price Field Is Active?'), |
215b423e | 426 | 'description' => ts('Is this price field active'), |
a36434b9 | 427 | 'where' => 'civicrm_price_field.is_active', |
e501603b | 428 | 'default' => '1', |
522a26c9 | 429 | 'table_name' => 'civicrm_price_field', |
430 | 'entity' => 'PriceField', | |
431 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 432 | 'localizable' => 0, |
c3fc2621 | 433 | 'html' => [ |
e501603b | 434 | 'type' => 'CheckBox', |
c3fc2621 | 435 | ], |
a9d0587b | 436 | 'add' => '1.8', |
c3fc2621 CW |
437 | ], |
438 | 'is_required' => [ | |
e501603b TO |
439 | 'name' => 'is_required', |
440 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 441 | 'title' => ts('Price Field is Required?'), |
215b423e | 442 | 'description' => ts('Is this price field required (value must be > 1)'), |
a36434b9 | 443 | 'where' => 'civicrm_price_field.is_required', |
e501603b | 444 | 'default' => '1', |
522a26c9 | 445 | 'table_name' => 'civicrm_price_field', |
446 | 'entity' => 'PriceField', | |
447 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 448 | 'localizable' => 0, |
c3fc2621 | 449 | 'html' => [ |
e501603b | 450 | 'type' => 'CheckBox', |
c3fc2621 | 451 | ], |
a9d0587b | 452 | 'add' => '1.8', |
c3fc2621 CW |
453 | ], |
454 | 'active_on' => [ | |
e501603b TO |
455 | 'name' => 'active_on', |
456 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
c3fc2621 | 457 | 'title' => ts('Price Field Start Date'), |
215b423e | 458 | 'description' => ts('If non-zero, do not show this field before the date specified'), |
a36434b9 | 459 | 'where' => 'civicrm_price_field.active_on', |
5fb0de1f | 460 | 'default' => NULL, |
522a26c9 | 461 | 'table_name' => 'civicrm_price_field', |
462 | 'entity' => 'PriceField', | |
463 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 464 | 'localizable' => 0, |
c3fc2621 | 465 | 'html' => [ |
70a44aee SL |
466 | 'type' => 'Select Date', |
467 | 'formatType' => 'activityDateTime', | |
c3fc2621 | 468 | ], |
a9d0587b | 469 | 'add' => '1.8', |
c3fc2621 CW |
470 | ], |
471 | 'expire_on' => [ | |
e501603b TO |
472 | 'name' => 'expire_on', |
473 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
c3fc2621 | 474 | 'title' => ts('Price Field End Date'), |
215b423e | 475 | 'description' => ts('If non-zero, do not show this field after the date specified'), |
a36434b9 | 476 | 'where' => 'civicrm_price_field.expire_on', |
5fb0de1f | 477 | 'default' => NULL, |
522a26c9 | 478 | 'table_name' => 'civicrm_price_field', |
479 | 'entity' => 'PriceField', | |
480 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 481 | 'localizable' => 0, |
c3fc2621 | 482 | 'html' => [ |
e501603b | 483 | 'type' => 'Select Date', |
70a44aee | 484 | 'formatType' => 'activityDateTime', |
c3fc2621 | 485 | ], |
a9d0587b | 486 | 'add' => '1.8', |
c3fc2621 CW |
487 | ], |
488 | 'javascript' => [ | |
e501603b TO |
489 | 'name' => 'javascript', |
490 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 491 | 'title' => ts('Price Field Javascript'), |
215b423e | 492 | 'description' => ts('Optional scripting attributes for field'), |
e501603b TO |
493 | 'maxlength' => 255, |
494 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 495 | 'where' => 'civicrm_price_field.javascript', |
522a26c9 | 496 | 'table_name' => 'civicrm_price_field', |
497 | 'entity' => 'PriceField', | |
498 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 499 | 'localizable' => 0, |
c3fc2621 | 500 | 'html' => [ |
e501603b | 501 | 'type' => 'Text', |
c3fc2621 | 502 | ], |
a9d0587b | 503 | 'add' => '1.8', |
c3fc2621 CW |
504 | ], |
505 | 'visibility_id' => [ | |
e501603b TO |
506 | 'name' => 'visibility_id', |
507 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 508 | 'title' => ts('Price Field Visibility'), |
215b423e | 509 | 'description' => ts('Implicit FK to civicrm_option_group with name = \'visibility\''), |
a36434b9 | 510 | 'where' => 'civicrm_price_field.visibility_id', |
e501603b | 511 | 'default' => '1', |
522a26c9 | 512 | 'table_name' => 'civicrm_price_field', |
513 | 'entity' => 'PriceField', | |
514 | 'bao' => 'CRM_Price_BAO_PriceField', | |
6a7e5e5d | 515 | 'localizable' => 0, |
c3fc2621 | 516 | 'html' => [ |
e501603b | 517 | 'type' => 'Select', |
c3fc2621 CW |
518 | ], |
519 | 'pseudoconstant' => [ | |
e501603b TO |
520 | 'optionGroupName' => 'visibility', |
521 | 'optionEditPath' => 'civicrm/admin/options/visibility', | |
e6ca0a57 | 522 | ], |
a9d0587b | 523 | 'add' => '3.2', |
c3fc2621 CW |
524 | ], |
525 | ]; | |
346aaaba | 526 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 527 | } |
346aaaba | 528 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 529 | } |
c3fc2621 | 530 | |
e501603b | 531 | /** |
bd8e0b14 | 532 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
533 | * |
534 | * @return array | |
bd8e0b14 | 535 | * Array(string $name => string $uniqueName). |
e501603b | 536 | */ |
c3fc2621 | 537 | public static function &fieldKeys() { |
bd8e0b14 TO |
538 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
539 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 540 | } |
bd8e0b14 | 541 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 542 | } |
c3fc2621 | 543 | |
e501603b TO |
544 | /** |
545 | * Returns the names of this table | |
546 | * | |
547 | * @return string | |
548 | */ | |
c3fc2621 | 549 | public static function getTableName() { |
e501603b TO |
550 | return CRM_Core_DAO::getLocaleTableName(self::$_tableName); |
551 | } | |
c3fc2621 | 552 | |
e501603b TO |
553 | /** |
554 | * Returns if this table needs to be logged | |
555 | * | |
c3fc2621 | 556 | * @return bool |
e501603b | 557 | */ |
c3fc2621 | 558 | public function getLog() { |
e501603b TO |
559 | return self::$_log; |
560 | } | |
c3fc2621 | 561 | |
e501603b TO |
562 | /** |
563 | * Returns the list of fields that can be imported | |
564 | * | |
565 | * @param bool $prefix | |
566 | * | |
567 | * @return array | |
568 | */ | |
c3fc2621 CW |
569 | public static function &import($prefix = FALSE) { |
570 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'price_field', $prefix, []); | |
60808919 | 571 | return $r; |
e501603b | 572 | } |
c3fc2621 | 573 | |
e501603b TO |
574 | /** |
575 | * Returns the list of fields that can be exported | |
576 | * | |
577 | * @param bool $prefix | |
578 | * | |
579 | * @return array | |
580 | */ | |
c3fc2621 CW |
581 | public static function &export($prefix = FALSE) { |
582 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'price_field', $prefix, []); | |
60808919 | 583 | return $r; |
e501603b | 584 | } |
c3fc2621 | 585 | |
e7a6b91a AS |
586 | /** |
587 | * Returns the list of indices | |
c3fc2621 CW |
588 | * |
589 | * @param bool $localize | |
590 | * | |
591 | * @return array | |
e7a6b91a AS |
592 | */ |
593 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
594 | $indices = [ |
595 | 'index_name' => [ | |
e7a6b91a | 596 | 'name' => 'index_name', |
c3fc2621 | 597 | 'field' => [ |
e7a6b91a | 598 | 0 => 'name', |
c3fc2621 CW |
599 | ], |
600 | 'localizable' => FALSE, | |
e7a6b91a | 601 | 'sig' => 'civicrm_price_field::0::name', |
c3fc2621 CW |
602 | ], |
603 | ]; | |
e7a6b91a AS |
604 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
605 | } | |
c3fc2621 | 606 | |
e501603b | 607 | } |