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:7da3309222cffae75ba3d149e8acb395)
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',
220 'price_field_id' => [
221 'name' => 'price_field_id',
222 'type' => CRM_Utils_Type
::T_INT
,
223 'title' => ts('Price Field ID'),
224 'description' => ts('FK to civicrm_price_field'),
226 'where' => 'civicrm_price_field_value.price_field_id',
227 'table_name' => 'civicrm_price_field_value',
228 'entity' => 'PriceFieldValue',
229 'bao' => 'CRM_Price_BAO_PriceFieldValue',
231 'FKClassName' => 'CRM_Price_DAO_PriceField',
233 'label' => ts("Price Field"),
239 'type' => CRM_Utils_Type
::T_STRING
,
240 'title' => ts('Name'),
241 'description' => ts('Price field option name'),
243 'size' => CRM_Utils_Type
::HUGE
,
244 'where' => 'civicrm_price_field_value.name',
246 'table_name' => 'civicrm_price_field_value',
247 'entity' => 'PriceFieldValue',
248 'bao' => 'CRM_Price_BAO_PriceFieldValue',
257 'type' => CRM_Utils_Type
::T_STRING
,
258 'title' => ts('Label'),
259 'description' => ts('Price field option label'),
261 'size' => CRM_Utils_Type
::HUGE
,
262 'where' => 'civicrm_price_field_value.label',
264 'table_name' => 'civicrm_price_field_value',
265 'entity' => 'PriceFieldValue',
266 'bao' => 'CRM_Price_BAO_PriceFieldValue',
274 'name' => 'description',
275 'type' => CRM_Utils_Type
::T_TEXT
,
276 'title' => ts('Description'),
277 'description' => ts('Price field option description.'),
280 'where' => 'civicrm_price_field_value.description',
282 'table_name' => 'civicrm_price_field_value',
283 'entity' => 'PriceFieldValue',
284 'bao' => 'CRM_Price_BAO_PriceFieldValue',
287 'type' => 'TextArea',
288 'label' => ts("Description"),
293 'name' => 'help_pre',
294 'type' => CRM_Utils_Type
::T_TEXT
,
295 'title' => ts('Help Pre'),
296 'description' => ts('Price field option pre help text.'),
299 'where' => 'civicrm_price_field_value.help_pre',
301 'table_name' => 'civicrm_price_field_value',
302 'entity' => 'PriceFieldValue',
303 'bao' => 'CRM_Price_BAO_PriceFieldValue',
306 'type' => 'TextArea',
307 'label' => ts("Pre Help"),
312 'name' => 'help_post',
313 'type' => CRM_Utils_Type
::T_TEXT
,
314 'title' => ts('Help Post'),
315 'description' => ts('Price field option post field help.'),
318 'where' => 'civicrm_price_field_value.help_post',
320 'table_name' => 'civicrm_price_field_value',
321 'entity' => 'PriceFieldValue',
322 'bao' => 'CRM_Price_BAO_PriceFieldValue',
325 'type' => 'TextArea',
326 'label' => ts("Post Help"),
332 'type' => CRM_Utils_Type
::T_MONEY
,
333 'title' => ts('Amount'),
334 'description' => ts('Price field option amount'),
340 'where' => 'civicrm_price_field_value.amount',
341 'table_name' => 'civicrm_price_field_value',
342 'entity' => 'PriceFieldValue',
343 'bao' => 'CRM_Price_BAO_PriceFieldValue',
352 'type' => CRM_Utils_Type
::T_INT
,
353 'title' => ts('Count'),
354 'description' => ts('Number of participants per field option'),
355 'where' => 'civicrm_price_field_value.count',
357 'table_name' => 'civicrm_price_field_value',
358 'entity' => 'PriceFieldValue',
359 'bao' => 'CRM_Price_BAO_PriceFieldValue',
363 'label' => ts("Count"),
368 'name' => 'max_value',
369 'type' => CRM_Utils_Type
::T_INT
,
370 'title' => ts('Max Value'),
371 'description' => ts('Max number of participants per field options'),
372 'where' => 'civicrm_price_field_value.max_value',
374 'table_name' => 'civicrm_price_field_value',
375 'entity' => 'PriceFieldValue',
376 'bao' => 'CRM_Price_BAO_PriceFieldValue',
380 'label' => ts("Max Value"),
386 'type' => CRM_Utils_Type
::T_INT
,
387 'title' => ts('Order'),
388 'description' => ts('Order in which the field options should appear'),
389 'where' => 'civicrm_price_field_value.weight',
391 'table_name' => 'civicrm_price_field_value',
392 'entity' => 'PriceFieldValue',
393 'bao' => 'CRM_Price_BAO_PriceFieldValue',
400 'membership_type_id' => [
401 'name' => 'membership_type_id',
402 'type' => CRM_Utils_Type
::T_INT
,
403 'title' => ts('Membership Type ID'),
404 'description' => ts('FK to Membership Type'),
405 'where' => 'civicrm_price_field_value.membership_type_id',
407 'table_name' => 'civicrm_price_field_value',
408 'entity' => 'PriceFieldValue',
409 'bao' => 'CRM_Price_BAO_PriceFieldValue',
411 'FKClassName' => 'CRM_Member_DAO_MembershipType',
414 'label' => ts("Membership Type"),
418 'membership_num_terms' => [
419 'name' => 'membership_num_terms',
420 'type' => CRM_Utils_Type
::T_INT
,
421 'title' => ts('Membership Num Terms'),
422 'description' => ts('Number of terms for this membership'),
423 'where' => 'civicrm_price_field_value.membership_num_terms',
425 'table_name' => 'civicrm_price_field_value',
426 'entity' => 'PriceFieldValue',
427 'bao' => 'CRM_Price_BAO_PriceFieldValue',
431 'label' => ts("Number of terms"),
436 'name' => 'is_default',
437 'type' => CRM_Utils_Type
::T_BOOLEAN
,
438 'title' => ts('Is Default Price Field Option?'),
439 'description' => ts('Is this default price field option'),
440 'where' => 'civicrm_price_field_value.is_default',
442 'table_name' => 'civicrm_price_field_value',
443 'entity' => 'PriceFieldValue',
444 'bao' => 'CRM_Price_BAO_PriceFieldValue',
447 'type' => 'CheckBox',
452 'name' => 'is_active',
453 'type' => CRM_Utils_Type
::T_BOOLEAN
,
454 'title' => ts('Price Field Value is Active'),
455 'description' => ts('Is this price field value active'),
456 'where' => 'civicrm_price_field_value.is_active',
458 'table_name' => 'civicrm_price_field_value',
459 'entity' => 'PriceFieldValue',
460 'bao' => 'CRM_Price_BAO_PriceFieldValue',
464 'financial_type_id' => [
465 'name' => 'financial_type_id',
466 'type' => CRM_Utils_Type
::T_INT
,
467 'title' => ts('Financial Type ID'),
468 'description' => ts('FK to Financial Type.'),
469 'where' => 'civicrm_price_field_value.financial_type_id',
471 'table_name' => 'civicrm_price_field_value',
472 'entity' => 'PriceFieldValue',
473 'bao' => 'CRM_Price_BAO_PriceFieldValue',
475 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
478 'label' => ts("Financial Type"),
480 'pseudoconstant' => [
481 'table' => 'civicrm_financial_type',
483 'labelColumn' => 'name',
487 'non_deductible_amount' => [
488 'name' => 'non_deductible_amount',
489 'type' => CRM_Utils_Type
::T_MONEY
,
490 'title' => ts('Non-deductible Amount'),
491 'description' => ts('Portion of total amount which is NOT tax deductible.'),
497 'where' => 'civicrm_price_field_value.non_deductible_amount',
498 'headerPattern' => '/non?.?deduct/i',
499 'dataPattern' => '/^\d+(\.\d{2})?$/',
501 'table_name' => 'civicrm_price_field_value',
502 'entity' => 'PriceFieldValue',
503 'bao' => 'CRM_Price_BAO_PriceFieldValue',
511 'name' => 'visibility_id',
512 'type' => CRM_Utils_Type
::T_INT
,
513 'title' => ts('Price Field Option Visibility'),
514 'description' => ts('Implicit FK to civicrm_option_group with name = \'visibility\''),
515 'where' => 'civicrm_price_field_value.visibility_id',
517 'table_name' => 'civicrm_price_field_value',
518 'entity' => 'PriceFieldValue',
519 'bao' => 'CRM_Price_BAO_PriceFieldValue',
524 'pseudoconstant' => [
525 'optionGroupName' => 'visibility',
526 'optionEditPath' => 'civicrm/admin/options/visibility',
531 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
533 return Civi
::$statics[__CLASS__
]['fields'];
537 * Return a mapping from field-name to the corresponding key (as used in fields()).
540 * Array(string $name => string $uniqueName).
542 public static function &fieldKeys() {
543 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
544 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
546 return Civi
::$statics[__CLASS__
]['fieldKeys'];
550 * Returns the names of this table
554 public static function getTableName() {
555 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
559 * Returns if this table needs to be logged
563 public function getLog() {
568 * Returns the list of fields that can be imported
570 * @param bool $prefix
574 public static function &import($prefix = FALSE) {
575 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_field_value', $prefix, []);
580 * Returns the list of fields that can be exported
582 * @param bool $prefix
586 public static function &export($prefix = FALSE) {
587 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_field_value', $prefix, []);
592 * Returns the list of indices
594 * @param bool $localize
598 public static function indices($localize = TRUE) {
600 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;