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:16987d2cc463a2d9290339ad37070f16)
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';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_price_field_value';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
41 * FK to civicrm_price_field
45 public $price_field_id;
48 * Price field option name
55 * Price field option label
62 * Price field option description.
69 * Price field option pre help text.
76 * Price field option post field help.
83 * Price field option amount
90 * Number of participants per field option
97 * Max number of participants per field options
104 * Order in which the field options should appear
111 * FK to Membership Type
115 public $membership_type_id;
118 * Number of terms for this membership
122 public $membership_num_terms;
125 * Is this default price field option
132 * Is this price field value active
139 * FK to Financial Type.
143 public $financial_type_id;
146 * Portion of total amount which is NOT tax deductible.
150 public $non_deductible_amount;
153 * Implicit FK to civicrm_option_group with name = 'visibility'
157 public $visibility_id;
162 public function __construct() {
163 $this->__table
= 'civicrm_price_field_value';
164 parent
::__construct();
168 * Returns localized title of this entity.
170 * @param bool $plural
171 * Whether to return the plural version of the title.
173 public static function getEntityTitle($plural = FALSE) {
174 return $plural ?
ts('Price Field Values') : ts('Price Field Value');
178 * Returns foreign keys and entity references.
181 * [CRM_Core_Reference_Interface]
183 public static function getReferenceColumns() {
184 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
185 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
186 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'price_field_id', 'civicrm_price_field', 'id');
187 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'membership_type_id', 'civicrm_membership_type', 'id');
188 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'financial_type_id', 'civicrm_financial_type', 'id');
189 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
191 return Civi
::$statics[__CLASS__
]['links'];
195 * Returns all the column names of this table
199 public static function &fields() {
200 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
201 Civi
::$statics[__CLASS__
]['fields'] = [
204 'type' => CRM_Utils_Type
::T_INT
,
205 'title' => ts('Price Field Value ID'),
206 'description' => ts('Price Field Value'),
208 'where' => 'civicrm_price_field_value.id',
209 'table_name' => 'civicrm_price_field_value',
210 'entity' => 'PriceFieldValue',
211 'bao' => 'CRM_Price_BAO_PriceFieldValue',
215 'price_field_id' => [
216 'name' => 'price_field_id',
217 'type' => CRM_Utils_Type
::T_INT
,
218 'title' => ts('Price Field'),
219 'description' => ts('FK to civicrm_price_field'),
221 'where' => 'civicrm_price_field_value.price_field_id',
222 'table_name' => 'civicrm_price_field_value',
223 'entity' => 'PriceFieldValue',
224 'bao' => 'CRM_Price_BAO_PriceFieldValue',
226 'FKClassName' => 'CRM_Price_DAO_PriceField',
231 'type' => CRM_Utils_Type
::T_STRING
,
232 'title' => ts('Name'),
233 'description' => ts('Price field option name'),
235 'size' => CRM_Utils_Type
::HUGE
,
236 'where' => 'civicrm_price_field_value.name',
238 'table_name' => 'civicrm_price_field_value',
239 'entity' => 'PriceFieldValue',
240 'bao' => 'CRM_Price_BAO_PriceFieldValue',
249 'type' => CRM_Utils_Type
::T_STRING
,
250 'title' => ts('Label'),
251 'description' => ts('Price field option label'),
253 'size' => CRM_Utils_Type
::HUGE
,
254 'where' => 'civicrm_price_field_value.label',
256 'table_name' => 'civicrm_price_field_value',
257 'entity' => 'PriceFieldValue',
258 'bao' => 'CRM_Price_BAO_PriceFieldValue',
266 'name' => 'description',
267 'type' => CRM_Utils_Type
::T_TEXT
,
268 'title' => ts('Description'),
269 'description' => ts('Price field option description.'),
272 'where' => 'civicrm_price_field_value.description',
274 'table_name' => 'civicrm_price_field_value',
275 'entity' => 'PriceFieldValue',
276 'bao' => 'CRM_Price_BAO_PriceFieldValue',
279 'type' => 'TextArea',
284 'name' => 'help_pre',
285 'type' => CRM_Utils_Type
::T_TEXT
,
286 'title' => ts('Help Pre'),
287 'description' => ts('Price field option pre help text.'),
290 'where' => 'civicrm_price_field_value.help_pre',
292 'table_name' => 'civicrm_price_field_value',
293 'entity' => 'PriceFieldValue',
294 'bao' => 'CRM_Price_BAO_PriceFieldValue',
297 'type' => 'TextArea',
302 'name' => 'help_post',
303 'type' => CRM_Utils_Type
::T_TEXT
,
304 'title' => ts('Help Post'),
305 'description' => ts('Price field option post field help.'),
308 'where' => 'civicrm_price_field_value.help_post',
310 'table_name' => 'civicrm_price_field_value',
311 'entity' => 'PriceFieldValue',
312 'bao' => 'CRM_Price_BAO_PriceFieldValue',
315 'type' => 'TextArea',
321 'type' => CRM_Utils_Type
::T_MONEY
,
322 'title' => ts('Amount'),
323 'description' => ts('Price field option amount'),
329 'where' => 'civicrm_price_field_value.amount',
330 'table_name' => 'civicrm_price_field_value',
331 'entity' => 'PriceFieldValue',
332 'bao' => 'CRM_Price_BAO_PriceFieldValue',
341 'type' => CRM_Utils_Type
::T_INT
,
342 'title' => ts('Count'),
343 'description' => ts('Number of participants per field option'),
344 'where' => 'civicrm_price_field_value.count',
346 'table_name' => 'civicrm_price_field_value',
347 'entity' => 'PriceFieldValue',
348 'bao' => 'CRM_Price_BAO_PriceFieldValue',
356 'name' => 'max_value',
357 'type' => CRM_Utils_Type
::T_INT
,
358 'title' => ts('Max Value'),
359 'description' => ts('Max number of participants per field options'),
360 'where' => 'civicrm_price_field_value.max_value',
362 'table_name' => 'civicrm_price_field_value',
363 'entity' => 'PriceFieldValue',
364 'bao' => 'CRM_Price_BAO_PriceFieldValue',
373 'type' => CRM_Utils_Type
::T_INT
,
374 'title' => ts('Order'),
375 'description' => ts('Order in which the field options should appear'),
376 'where' => 'civicrm_price_field_value.weight',
378 'table_name' => 'civicrm_price_field_value',
379 'entity' => 'PriceFieldValue',
380 'bao' => 'CRM_Price_BAO_PriceFieldValue',
387 'membership_type_id' => [
388 'name' => 'membership_type_id',
389 'type' => CRM_Utils_Type
::T_INT
,
390 'title' => ts('Membership Type'),
391 'description' => ts('FK to Membership Type'),
392 'where' => 'civicrm_price_field_value.membership_type_id',
394 'table_name' => 'civicrm_price_field_value',
395 'entity' => 'PriceFieldValue',
396 'bao' => 'CRM_Price_BAO_PriceFieldValue',
398 'FKClassName' => 'CRM_Member_DAO_MembershipType',
404 'membership_num_terms' => [
405 'name' => 'membership_num_terms',
406 'type' => CRM_Utils_Type
::T_INT
,
407 'title' => ts('Membership Num Terms'),
408 'description' => ts('Number of terms for this membership'),
409 'where' => 'civicrm_price_field_value.membership_num_terms',
411 'table_name' => 'civicrm_price_field_value',
412 'entity' => 'PriceFieldValue',
413 'bao' => 'CRM_Price_BAO_PriceFieldValue',
421 'name' => 'is_default',
422 'type' => CRM_Utils_Type
::T_BOOLEAN
,
423 'title' => ts('Is Default Price Field Option?'),
424 'description' => ts('Is this default price field option'),
425 'where' => 'civicrm_price_field_value.is_default',
427 'table_name' => 'civicrm_price_field_value',
428 'entity' => 'PriceFieldValue',
429 'bao' => 'CRM_Price_BAO_PriceFieldValue',
432 'type' => 'CheckBox',
437 'name' => 'is_active',
438 'type' => CRM_Utils_Type
::T_BOOLEAN
,
439 'title' => ts('Price Field Value is Active'),
440 'description' => ts('Is this price field value active'),
441 'where' => 'civicrm_price_field_value.is_active',
443 'table_name' => 'civicrm_price_field_value',
444 'entity' => 'PriceFieldValue',
445 'bao' => 'CRM_Price_BAO_PriceFieldValue',
449 'financial_type_id' => [
450 'name' => 'financial_type_id',
451 'type' => CRM_Utils_Type
::T_INT
,
452 'title' => ts('Financial Type'),
453 'description' => ts('FK to Financial Type.'),
454 'where' => 'civicrm_price_field_value.financial_type_id',
456 'table_name' => 'civicrm_price_field_value',
457 'entity' => 'PriceFieldValue',
458 'bao' => 'CRM_Price_BAO_PriceFieldValue',
460 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
464 'pseudoconstant' => [
465 'table' => 'civicrm_financial_type',
467 'labelColumn' => 'name',
471 'non_deductible_amount' => [
472 'name' => 'non_deductible_amount',
473 'type' => CRM_Utils_Type
::T_MONEY
,
474 'title' => ts('Non-deductible Amount'),
475 'description' => ts('Portion of total amount which is NOT tax deductible.'),
481 'where' => 'civicrm_price_field_value.non_deductible_amount',
482 'headerPattern' => '/non?.?deduct/i',
483 'dataPattern' => '/^\d+(\.\d{2})?$/',
485 'table_name' => 'civicrm_price_field_value',
486 'entity' => 'PriceFieldValue',
487 'bao' => 'CRM_Price_BAO_PriceFieldValue',
495 'name' => 'visibility_id',
496 'type' => CRM_Utils_Type
::T_INT
,
497 'title' => ts('Price Field Option Visibility'),
498 'description' => ts('Implicit FK to civicrm_option_group with name = \'visibility\''),
499 'where' => 'civicrm_price_field_value.visibility_id',
501 'table_name' => 'civicrm_price_field_value',
502 'entity' => 'PriceFieldValue',
503 'bao' => 'CRM_Price_BAO_PriceFieldValue',
508 'pseudoconstant' => [
509 'optionGroupName' => 'visibility',
510 'optionEditPath' => 'civicrm/admin/options/visibility',
515 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
517 return Civi
::$statics[__CLASS__
]['fields'];
521 * Return a mapping from field-name to the corresponding key (as used in fields()).
524 * Array(string $name => string $uniqueName).
526 public static function &fieldKeys() {
527 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
528 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
530 return Civi
::$statics[__CLASS__
]['fieldKeys'];
534 * Returns the names of this table
538 public static function getTableName() {
539 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
543 * Returns if this table needs to be logged
547 public function getLog() {
552 * Returns the list of fields that can be imported
554 * @param bool $prefix
558 public static function &import($prefix = FALSE) {
559 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_field_value', $prefix, []);
564 * Returns the list of fields that can be exported
566 * @param bool $prefix
570 public static function &export($prefix = FALSE) {
571 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_field_value', $prefix, []);
576 * Returns the list of indices
578 * @param bool $localize
582 public static function indices($localize = TRUE) {
584 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;