5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Price/PriceFieldValue.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:dfd666e126f31f5c1f5f9c7c47050d4f)
13 * Database access object for the PriceFieldValue entity.
15 class CRM_Price_DAO_PriceFieldValue
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '3.3';
18 const COMPONENT
= 'CiviContribute';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_price_field_value';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = FALSE;
42 * FK to civicrm_price_field
46 public $price_field_id;
49 * Price field option name
56 * Price field option label
63 * Price field option description.
70 * Price field option pre help text.
77 * Price field option post field help.
84 * Price field option amount
91 * Number of participants per field option
98 * Max number of participants per field options
105 * Order in which the field options should appear
112 * FK to Membership Type
116 public $membership_type_id;
119 * Number of terms for this membership
123 public $membership_num_terms;
126 * Is this default price field option
133 * Is this price field value active
140 * FK to Financial Type.
144 public $financial_type_id;
147 * Portion of total amount which is NOT tax deductible.
151 public $non_deductible_amount;
154 * Implicit FK to civicrm_option_group with name = 'visibility'
158 public $visibility_id;
163 public function __construct() {
164 $this->__table
= 'civicrm_price_field_value';
165 parent
::__construct();
169 * Returns localized title of this entity.
171 * @param bool $plural
172 * Whether to return the plural version of the title.
174 public static function getEntityTitle($plural = FALSE) {
175 return $plural ?
ts('Price Field Values') : ts('Price Field Value');
179 * Returns foreign keys and entity references.
182 * [CRM_Core_Reference_Interface]
184 public static function getReferenceColumns() {
185 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
186 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
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');
190 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
192 return Civi
::$statics[__CLASS__
]['links'];
196 * Returns all the column names of this table
200 public static function &fields() {
201 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
202 Civi
::$statics[__CLASS__
]['fields'] = [
205 'type' => CRM_Utils_Type
::T_INT
,
206 'title' => ts('Price Field Value ID'),
207 'description' => ts('Price Field Value'),
209 'where' => 'civicrm_price_field_value.id',
210 'table_name' => 'civicrm_price_field_value',
211 'entity' => 'PriceFieldValue',
212 'bao' => 'CRM_Price_BAO_PriceFieldValue',
219 'price_field_id' => [
220 'name' => 'price_field_id',
221 'type' => CRM_Utils_Type
::T_INT
,
222 'title' => ts('Price Field ID'),
223 'description' => ts('FK to civicrm_price_field'),
225 'where' => 'civicrm_price_field_value.price_field_id',
226 'table_name' => 'civicrm_price_field_value',
227 'entity' => 'PriceFieldValue',
228 'bao' => 'CRM_Price_BAO_PriceFieldValue',
230 'FKClassName' => 'CRM_Price_DAO_PriceField',
232 'label' => ts("Price Field"),
238 'type' => CRM_Utils_Type
::T_STRING
,
239 'title' => ts('Name'),
240 'description' => ts('Price field option name'),
242 'size' => CRM_Utils_Type
::HUGE
,
243 'where' => 'civicrm_price_field_value.name',
245 'table_name' => 'civicrm_price_field_value',
246 'entity' => 'PriceFieldValue',
247 'bao' => 'CRM_Price_BAO_PriceFieldValue',
256 'type' => CRM_Utils_Type
::T_STRING
,
257 'title' => ts('Label'),
258 'description' => ts('Price field option label'),
260 'size' => CRM_Utils_Type
::HUGE
,
261 'where' => 'civicrm_price_field_value.label',
263 'table_name' => 'civicrm_price_field_value',
264 'entity' => 'PriceFieldValue',
265 'bao' => 'CRM_Price_BAO_PriceFieldValue',
273 'name' => 'description',
274 'type' => CRM_Utils_Type
::T_TEXT
,
275 'title' => ts('Description'),
276 'description' => ts('Price field option description.'),
279 'where' => 'civicrm_price_field_value.description',
281 'table_name' => 'civicrm_price_field_value',
282 'entity' => 'PriceFieldValue',
283 'bao' => 'CRM_Price_BAO_PriceFieldValue',
286 'type' => 'TextArea',
291 'name' => 'help_pre',
292 'type' => CRM_Utils_Type
::T_TEXT
,
293 'title' => ts('Help Pre'),
294 'description' => ts('Price field option pre help text.'),
297 'where' => 'civicrm_price_field_value.help_pre',
299 'table_name' => 'civicrm_price_field_value',
300 'entity' => 'PriceFieldValue',
301 'bao' => 'CRM_Price_BAO_PriceFieldValue',
304 'type' => 'TextArea',
309 'name' => 'help_post',
310 'type' => CRM_Utils_Type
::T_TEXT
,
311 'title' => ts('Help Post'),
312 'description' => ts('Price field option post field help.'),
315 'where' => 'civicrm_price_field_value.help_post',
317 'table_name' => 'civicrm_price_field_value',
318 'entity' => 'PriceFieldValue',
319 'bao' => 'CRM_Price_BAO_PriceFieldValue',
322 'type' => 'TextArea',
328 'type' => CRM_Utils_Type
::T_MONEY
,
329 'title' => ts('Amount'),
330 'description' => ts('Price field option amount'),
336 'where' => 'civicrm_price_field_value.amount',
337 'table_name' => 'civicrm_price_field_value',
338 'entity' => 'PriceFieldValue',
339 'bao' => 'CRM_Price_BAO_PriceFieldValue',
348 'type' => CRM_Utils_Type
::T_INT
,
349 'title' => ts('Count'),
350 'description' => ts('Number of participants per field option'),
351 'where' => 'civicrm_price_field_value.count',
353 'table_name' => 'civicrm_price_field_value',
354 'entity' => 'PriceFieldValue',
355 'bao' => 'CRM_Price_BAO_PriceFieldValue',
363 'name' => 'max_value',
364 'type' => CRM_Utils_Type
::T_INT
,
365 'title' => ts('Max Value'),
366 'description' => ts('Max number of participants per field options'),
367 'where' => 'civicrm_price_field_value.max_value',
369 'table_name' => 'civicrm_price_field_value',
370 'entity' => 'PriceFieldValue',
371 'bao' => 'CRM_Price_BAO_PriceFieldValue',
380 'type' => CRM_Utils_Type
::T_INT
,
381 'title' => ts('Order'),
382 'description' => ts('Order in which the field options should appear'),
383 'where' => 'civicrm_price_field_value.weight',
385 'table_name' => 'civicrm_price_field_value',
386 'entity' => 'PriceFieldValue',
387 'bao' => 'CRM_Price_BAO_PriceFieldValue',
394 'membership_type_id' => [
395 'name' => 'membership_type_id',
396 'type' => CRM_Utils_Type
::T_INT
,
397 'title' => ts('Membership Type ID'),
398 'description' => ts('FK to Membership Type'),
399 'where' => 'civicrm_price_field_value.membership_type_id',
401 'table_name' => 'civicrm_price_field_value',
402 'entity' => 'PriceFieldValue',
403 'bao' => 'CRM_Price_BAO_PriceFieldValue',
405 'FKClassName' => 'CRM_Member_DAO_MembershipType',
408 'label' => ts("Membership Type"),
412 'membership_num_terms' => [
413 'name' => 'membership_num_terms',
414 'type' => CRM_Utils_Type
::T_INT
,
415 'title' => ts('Membership Num Terms'),
416 'description' => ts('Number of terms for this membership'),
417 'where' => 'civicrm_price_field_value.membership_num_terms',
419 'table_name' => 'civicrm_price_field_value',
420 'entity' => 'PriceFieldValue',
421 'bao' => 'CRM_Price_BAO_PriceFieldValue',
429 'name' => 'is_default',
430 'type' => CRM_Utils_Type
::T_BOOLEAN
,
431 'title' => ts('Is Default Price Field Option?'),
432 'description' => ts('Is this default price field option'),
433 'where' => 'civicrm_price_field_value.is_default',
435 'table_name' => 'civicrm_price_field_value',
436 'entity' => 'PriceFieldValue',
437 'bao' => 'CRM_Price_BAO_PriceFieldValue',
440 'type' => 'CheckBox',
445 'name' => 'is_active',
446 'type' => CRM_Utils_Type
::T_BOOLEAN
,
447 'title' => ts('Price Field Value is Active'),
448 'description' => ts('Is this price field value active'),
449 'where' => 'civicrm_price_field_value.is_active',
451 'table_name' => 'civicrm_price_field_value',
452 'entity' => 'PriceFieldValue',
453 'bao' => 'CRM_Price_BAO_PriceFieldValue',
457 'financial_type_id' => [
458 'name' => 'financial_type_id',
459 'type' => CRM_Utils_Type
::T_INT
,
460 'title' => ts('Financial Type ID'),
461 'description' => ts('FK to Financial Type.'),
462 'where' => 'civicrm_price_field_value.financial_type_id',
464 'table_name' => 'civicrm_price_field_value',
465 'entity' => 'PriceFieldValue',
466 'bao' => 'CRM_Price_BAO_PriceFieldValue',
468 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
471 'label' => ts("Financial Type"),
473 'pseudoconstant' => [
474 'table' => 'civicrm_financial_type',
476 'labelColumn' => 'name',
480 'non_deductible_amount' => [
481 'name' => 'non_deductible_amount',
482 'type' => CRM_Utils_Type
::T_MONEY
,
483 'title' => ts('Non-deductible Amount'),
484 'description' => ts('Portion of total amount which is NOT tax deductible.'),
490 'where' => 'civicrm_price_field_value.non_deductible_amount',
491 'headerPattern' => '/non?.?deduct/i',
492 'dataPattern' => '/^\d+(\.\d{2})?$/',
494 'table_name' => 'civicrm_price_field_value',
495 'entity' => 'PriceFieldValue',
496 'bao' => 'CRM_Price_BAO_PriceFieldValue',
504 'name' => 'visibility_id',
505 'type' => CRM_Utils_Type
::T_INT
,
506 'title' => ts('Price Field Option Visibility'),
507 'description' => ts('Implicit FK to civicrm_option_group with name = \'visibility\''),
508 'where' => 'civicrm_price_field_value.visibility_id',
510 'table_name' => 'civicrm_price_field_value',
511 'entity' => 'PriceFieldValue',
512 'bao' => 'CRM_Price_BAO_PriceFieldValue',
517 'pseudoconstant' => [
518 'optionGroupName' => 'visibility',
519 'optionEditPath' => 'civicrm/admin/options/visibility',
524 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
526 return Civi
::$statics[__CLASS__
]['fields'];
530 * Return a mapping from field-name to the corresponding key (as used in fields()).
533 * Array(string $name => string $uniqueName).
535 public static function &fieldKeys() {
536 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
537 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
539 return Civi
::$statics[__CLASS__
]['fieldKeys'];
543 * Returns the names of this table
547 public static function getTableName() {
548 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
552 * Returns if this table needs to be logged
556 public function getLog() {
561 * Returns the list of fields that can be imported
563 * @param bool $prefix
567 public static function &import($prefix = FALSE) {
568 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_field_value', $prefix, []);
573 * Returns the list of fields that can be exported
575 * @param bool $prefix
579 public static function &export($prefix = FALSE) {
580 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_field_value', $prefix, []);
585 * Returns the list of indices
587 * @param bool $localize
591 public static function indices($localize = TRUE) {
593 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;