5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Price/PriceField.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:88307b88d5be27887068a778e663b0a2)
13 * Database access object for the PriceField entity.
15 class CRM_Price_DAO_PriceField
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_price_field';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
39 * FK to civicrm_price_set
46 * Variable name/programmatic handle for this field.
53 * Text for form field label (also friendly name for administering this field).
65 * Enter a quantity for this field?
72 * Description and/or help text to display before this field.
79 * Description and/or help text to display after this field.
86 * Order in which the fields should appear
93 * Should the price be displayed next to the label for each option?
97 public $is_display_amounts;
100 * number of options per line for checkbox and radio
104 public $options_per_line;
107 * Is this price field active
114 * Is this price field required (value must be > 1)
121 * If non-zero, do not show this field before the date specified
128 * If non-zero, do not show this field after the date specified
135 * Optional scripting attributes for field
142 * Implicit FK to civicrm_option_group with name = 'visibility'
146 public $visibility_id;
151 public function __construct() {
152 $this->__table
= 'civicrm_price_field';
153 parent
::__construct();
157 * Returns foreign keys and entity references.
160 * [CRM_Core_Reference_Interface]
162 public static function getReferenceColumns() {
163 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
164 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
165 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'price_set_id', 'civicrm_price_set', 'id');
166 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
168 return Civi
::$statics[__CLASS__
]['links'];
172 * Returns all the column names of this table
176 public static function &fields() {
177 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
178 Civi
::$statics[__CLASS__
]['fields'] = [
181 'type' => CRM_Utils_Type
::T_INT
,
182 'title' => ts('Price Field ID'),
183 'description' => ts('Price Field'),
185 'where' => 'civicrm_price_field.id',
186 'table_name' => 'civicrm_price_field',
187 'entity' => 'PriceField',
188 'bao' => 'CRM_Price_BAO_PriceField',
192 'name' => 'price_set_id',
193 'type' => CRM_Utils_Type
::T_INT
,
194 'title' => ts('Price Set'),
195 'description' => ts('FK to civicrm_price_set'),
197 'where' => 'civicrm_price_field.price_set_id',
198 'table_name' => 'civicrm_price_field',
199 'entity' => 'PriceField',
200 'bao' => 'CRM_Price_BAO_PriceField',
202 'FKClassName' => 'CRM_Price_DAO_PriceSet',
203 'pseudoconstant' => [
204 'table' => 'civicrm_price_set',
206 'labelColumn' => 'title',
211 'type' => CRM_Utils_Type
::T_STRING
,
212 'title' => ts('Name'),
213 'description' => ts('Variable name/programmatic handle for this field.'),
216 'size' => CRM_Utils_Type
::HUGE
,
217 'where' => 'civicrm_price_field.name',
218 'table_name' => 'civicrm_price_field',
219 'entity' => 'PriceField',
220 'bao' => 'CRM_Price_BAO_PriceField',
228 'type' => CRM_Utils_Type
::T_STRING
,
229 'title' => ts('Label'),
230 'description' => ts('Text for form field label (also friendly name for administering this field).'),
233 'size' => CRM_Utils_Type
::HUGE
,
234 'where' => 'civicrm_price_field.label',
235 'table_name' => 'civicrm_price_field',
236 'entity' => 'PriceField',
237 'bao' => 'CRM_Price_BAO_PriceField',
244 'name' => 'html_type',
245 'type' => CRM_Utils_Type
::T_STRING
,
246 'title' => ts('Html Type'),
249 'size' => CRM_Utils_Type
::TWELVE
,
250 'where' => 'civicrm_price_field.html_type',
251 'table_name' => 'civicrm_price_field',
252 'entity' => 'PriceField',
253 'bao' => 'CRM_Price_BAO_PriceField',
258 'pseudoconstant' => [
259 'callback' => 'CRM_Price_BAO_PriceField::htmlTypes',
263 'name' => 'is_enter_qty',
264 'type' => CRM_Utils_Type
::T_BOOLEAN
,
265 'title' => ts('Price Field Quantity Required?'),
266 'description' => ts('Enter a quantity for this field?'),
267 'where' => 'civicrm_price_field.is_enter_qty',
269 'table_name' => 'civicrm_price_field',
270 'entity' => 'PriceField',
271 'bao' => 'CRM_Price_BAO_PriceField',
274 'type' => 'CheckBox',
278 'name' => 'help_pre',
279 'type' => CRM_Utils_Type
::T_TEXT
,
280 'title' => ts('Price Field Pre Text'),
281 'description' => ts('Description and/or help text to display before this field.'),
284 'where' => 'civicrm_price_field.help_pre',
285 'table_name' => 'civicrm_price_field',
286 'entity' => 'PriceField',
287 'bao' => 'CRM_Price_BAO_PriceField',
290 'type' => 'TextArea',
294 'name' => 'help_post',
295 'type' => CRM_Utils_Type
::T_TEXT
,
296 'title' => ts('Price Field Post Text'),
297 'description' => ts('Description and/or help text to display after this field.'),
300 'where' => 'civicrm_price_field.help_post',
301 'table_name' => 'civicrm_price_field',
302 'entity' => 'PriceField',
303 'bao' => 'CRM_Price_BAO_PriceField',
306 'type' => 'TextArea',
311 'type' => CRM_Utils_Type
::T_INT
,
312 'title' => ts('Order'),
313 'description' => ts('Order in which the fields should appear'),
314 'where' => 'civicrm_price_field.weight',
316 'table_name' => 'civicrm_price_field',
317 'entity' => 'PriceField',
318 'bao' => 'CRM_Price_BAO_PriceField',
324 'is_display_amounts' => [
325 'name' => 'is_display_amounts',
326 'type' => CRM_Utils_Type
::T_BOOLEAN
,
327 'title' => ts('Price Field Show Amounts?'),
328 'description' => ts('Should the price be displayed next to the label for each option?'),
329 'where' => 'civicrm_price_field.is_display_amounts',
331 'table_name' => 'civicrm_price_field',
332 'entity' => 'PriceField',
333 'bao' => 'CRM_Price_BAO_PriceField',
336 'type' => 'CheckBox',
339 'options_per_line' => [
340 'name' => 'options_per_line',
341 'type' => CRM_Utils_Type
::T_INT
,
342 'title' => ts('Price Field Options per Row'),
343 'description' => ts('number of options per line for checkbox and radio'),
344 'where' => 'civicrm_price_field.options_per_line',
346 'table_name' => 'civicrm_price_field',
347 'entity' => 'PriceField',
348 'bao' => 'CRM_Price_BAO_PriceField',
355 'name' => 'is_active',
356 'type' => CRM_Utils_Type
::T_BOOLEAN
,
357 'title' => ts('Price Field Is Active?'),
358 'description' => ts('Is this price field active'),
359 'where' => 'civicrm_price_field.is_active',
361 'table_name' => 'civicrm_price_field',
362 'entity' => 'PriceField',
363 'bao' => 'CRM_Price_BAO_PriceField',
366 'type' => 'CheckBox',
370 'name' => 'is_required',
371 'type' => CRM_Utils_Type
::T_BOOLEAN
,
372 'title' => ts('Price Field is Required?'),
373 'description' => ts('Is this price field required (value must be > 1)'),
374 'where' => 'civicrm_price_field.is_required',
376 'table_name' => 'civicrm_price_field',
377 'entity' => 'PriceField',
378 'bao' => 'CRM_Price_BAO_PriceField',
381 'type' => 'CheckBox',
385 'name' => 'active_on',
386 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
387 'title' => ts('Price Field Start Date'),
388 'description' => ts('If non-zero, do not show this field before the date specified'),
389 'where' => 'civicrm_price_field.active_on',
391 'table_name' => 'civicrm_price_field',
392 'entity' => 'PriceField',
393 'bao' => 'CRM_Price_BAO_PriceField',
396 'type' => 'Select Date',
397 'formatType' => 'activityDateTime',
401 'name' => 'expire_on',
402 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
403 'title' => ts('Price Field End Date'),
404 'description' => ts('If non-zero, do not show this field after the date specified'),
405 'where' => 'civicrm_price_field.expire_on',
407 'table_name' => 'civicrm_price_field',
408 'entity' => 'PriceField',
409 'bao' => 'CRM_Price_BAO_PriceField',
412 'type' => 'Select Date',
413 'formatType' => 'activityDateTime',
417 'name' => 'javascript',
418 'type' => CRM_Utils_Type
::T_STRING
,
419 'title' => ts('Price Field Javascript'),
420 'description' => ts('Optional scripting attributes for field'),
422 'size' => CRM_Utils_Type
::HUGE
,
423 'where' => 'civicrm_price_field.javascript',
424 'table_name' => 'civicrm_price_field',
425 'entity' => 'PriceField',
426 'bao' => 'CRM_Price_BAO_PriceField',
433 'name' => 'visibility_id',
434 'type' => CRM_Utils_Type
::T_INT
,
435 'title' => ts('Price Field Visibility'),
436 'description' => ts('Implicit FK to civicrm_option_group with name = \'visibility\''),
437 'where' => 'civicrm_price_field.visibility_id',
439 'table_name' => 'civicrm_price_field',
440 'entity' => 'PriceField',
441 'bao' => 'CRM_Price_BAO_PriceField',
446 'pseudoconstant' => [
447 'optionGroupName' => 'visibility',
448 'optionEditPath' => 'civicrm/admin/options/visibility',
452 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
454 return Civi
::$statics[__CLASS__
]['fields'];
458 * Return a mapping from field-name to the corresponding key (as used in fields()).
461 * Array(string $name => string $uniqueName).
463 public static function &fieldKeys() {
464 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
465 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
467 return Civi
::$statics[__CLASS__
]['fieldKeys'];
471 * Returns the names of this table
475 public static function getTableName() {
476 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
480 * Returns if this table needs to be logged
484 public function getLog() {
489 * Returns the list of fields that can be imported
491 * @param bool $prefix
495 public static function &import($prefix = FALSE) {
496 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_field', $prefix, []);
501 * Returns the list of fields that can be exported
503 * @param bool $prefix
507 public static function &export($prefix = FALSE) {
508 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_field', $prefix, []);
513 * Returns the list of indices
515 * @param bool $localize
519 public static function indices($localize = TRUE) {
522 'name' => 'index_name',
526 'localizable' => FALSE,
527 'sig' => 'civicrm_price_field::0::name',
530 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;