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