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:11a02f3576be10e8c2a0ea47a19e2dac)
13 * Database access object for the PriceFieldValue entity.
15 class CRM_Price_DAO_PriceFieldValue
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_price_field_value';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * FK to civicrm_price_field
43 public $price_field_id;
46 * Price field option name
53 * Price field option label
60 * Price field option description.
67 * Price field option pre help text.
74 * Price field option post field help.
81 * Price field option amount
88 * Number of participants per field option
95 * Max number of participants per field options
102 * Order in which the field options should appear
109 * FK to Membership Type
113 public $membership_type_id;
116 * Number of terms for this membership
120 public $membership_num_terms;
123 * Is this default price field option
130 * Is this price field value active
137 * FK to Financial Type.
141 public $financial_type_id;
144 * Portion of total amount which is NOT tax deductible.
148 public $non_deductible_amount;
151 * Implicit FK to civicrm_option_group with name = 'visibility'
155 public $visibility_id;
160 public function __construct() {
161 $this->__table
= 'civicrm_price_field_value';
162 parent
::__construct();
166 * Returns localized title of this entity.
168 public static function getEntityTitle() {
169 return ts('Price Field Values');
173 * Returns foreign keys and entity references.
176 * [CRM_Core_Reference_Interface]
178 public static function getReferenceColumns() {
179 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
180 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
181 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'price_field_id', 'civicrm_price_field', 'id');
182 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'membership_type_id', 'civicrm_membership_type', 'id');
183 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'financial_type_id', 'civicrm_financial_type', 'id');
184 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
186 return Civi
::$statics[__CLASS__
]['links'];
190 * Returns all the column names of this table
194 public static function &fields() {
195 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
196 Civi
::$statics[__CLASS__
]['fields'] = [
199 'type' => CRM_Utils_Type
::T_INT
,
200 'title' => ts('Price Field Value ID'),
201 'description' => ts('Price Field Value'),
203 'where' => 'civicrm_price_field_value.id',
204 'table_name' => 'civicrm_price_field_value',
205 'entity' => 'PriceFieldValue',
206 'bao' => 'CRM_Price_BAO_PriceFieldValue',
210 'price_field_id' => [
211 'name' => 'price_field_id',
212 'type' => CRM_Utils_Type
::T_INT
,
213 'title' => ts('Price Field'),
214 'description' => ts('FK to civicrm_price_field'),
216 'where' => 'civicrm_price_field_value.price_field_id',
217 'table_name' => 'civicrm_price_field_value',
218 'entity' => 'PriceFieldValue',
219 'bao' => 'CRM_Price_BAO_PriceFieldValue',
221 'FKClassName' => 'CRM_Price_DAO_PriceField',
226 'type' => CRM_Utils_Type
::T_STRING
,
227 'title' => ts('Name'),
228 'description' => ts('Price field option name'),
230 'size' => CRM_Utils_Type
::HUGE
,
231 'where' => 'civicrm_price_field_value.name',
233 'table_name' => 'civicrm_price_field_value',
234 'entity' => 'PriceFieldValue',
235 'bao' => 'CRM_Price_BAO_PriceFieldValue',
244 'type' => CRM_Utils_Type
::T_STRING
,
245 'title' => ts('Label'),
246 'description' => ts('Price field option label'),
248 'size' => CRM_Utils_Type
::HUGE
,
249 'where' => 'civicrm_price_field_value.label',
251 'table_name' => 'civicrm_price_field_value',
252 'entity' => 'PriceFieldValue',
253 'bao' => 'CRM_Price_BAO_PriceFieldValue',
261 'name' => 'description',
262 'type' => CRM_Utils_Type
::T_TEXT
,
263 'title' => ts('Description'),
264 'description' => ts('Price field option description.'),
267 'where' => 'civicrm_price_field_value.description',
269 'table_name' => 'civicrm_price_field_value',
270 'entity' => 'PriceFieldValue',
271 'bao' => 'CRM_Price_BAO_PriceFieldValue',
274 'type' => 'TextArea',
279 'name' => 'help_pre',
280 'type' => CRM_Utils_Type
::T_TEXT
,
281 'title' => ts('Help Pre'),
282 'description' => ts('Price field option pre help text.'),
285 'where' => 'civicrm_price_field_value.help_pre',
287 'table_name' => 'civicrm_price_field_value',
288 'entity' => 'PriceFieldValue',
289 'bao' => 'CRM_Price_BAO_PriceFieldValue',
292 'type' => 'TextArea',
297 'name' => 'help_post',
298 'type' => CRM_Utils_Type
::T_TEXT
,
299 'title' => ts('Help Post'),
300 'description' => ts('Price field option post field help.'),
303 'where' => 'civicrm_price_field_value.help_post',
305 'table_name' => 'civicrm_price_field_value',
306 'entity' => 'PriceFieldValue',
307 'bao' => 'CRM_Price_BAO_PriceFieldValue',
310 'type' => 'TextArea',
316 'type' => CRM_Utils_Type
::T_MONEY
,
317 'title' => ts('Amount'),
318 'description' => ts('Price field option amount'),
324 'where' => 'civicrm_price_field_value.amount',
325 'table_name' => 'civicrm_price_field_value',
326 'entity' => 'PriceFieldValue',
327 'bao' => 'CRM_Price_BAO_PriceFieldValue',
336 'type' => CRM_Utils_Type
::T_INT
,
337 'title' => ts('Count'),
338 'description' => ts('Number of participants per field option'),
339 'where' => 'civicrm_price_field_value.count',
341 'table_name' => 'civicrm_price_field_value',
342 'entity' => 'PriceFieldValue',
343 'bao' => 'CRM_Price_BAO_PriceFieldValue',
351 'name' => 'max_value',
352 'type' => CRM_Utils_Type
::T_INT
,
353 'title' => ts('Max Value'),
354 'description' => ts('Max number of participants per field options'),
355 'where' => 'civicrm_price_field_value.max_value',
357 'table_name' => 'civicrm_price_field_value',
358 'entity' => 'PriceFieldValue',
359 'bao' => 'CRM_Price_BAO_PriceFieldValue',
368 'type' => CRM_Utils_Type
::T_INT
,
369 'title' => ts('Order'),
370 'description' => ts('Order in which the field options should appear'),
371 'where' => 'civicrm_price_field_value.weight',
373 'table_name' => 'civicrm_price_field_value',
374 'entity' => 'PriceFieldValue',
375 'bao' => 'CRM_Price_BAO_PriceFieldValue',
382 'membership_type_id' => [
383 'name' => 'membership_type_id',
384 'type' => CRM_Utils_Type
::T_INT
,
385 'title' => ts('Membership Type'),
386 'description' => ts('FK to Membership Type'),
387 'where' => 'civicrm_price_field_value.membership_type_id',
389 'table_name' => 'civicrm_price_field_value',
390 'entity' => 'PriceFieldValue',
391 'bao' => 'CRM_Price_BAO_PriceFieldValue',
393 'FKClassName' => 'CRM_Member_DAO_MembershipType',
399 'membership_num_terms' => [
400 'name' => 'membership_num_terms',
401 'type' => CRM_Utils_Type
::T_INT
,
402 'title' => ts('Membership Num Terms'),
403 'description' => ts('Number of terms for this membership'),
404 'where' => 'civicrm_price_field_value.membership_num_terms',
406 'table_name' => 'civicrm_price_field_value',
407 'entity' => 'PriceFieldValue',
408 'bao' => 'CRM_Price_BAO_PriceFieldValue',
416 'name' => 'is_default',
417 'type' => CRM_Utils_Type
::T_BOOLEAN
,
418 'title' => ts('Is Default Price Field Option?'),
419 'description' => ts('Is this default price field option'),
420 'where' => 'civicrm_price_field_value.is_default',
422 'table_name' => 'civicrm_price_field_value',
423 'entity' => 'PriceFieldValue',
424 'bao' => 'CRM_Price_BAO_PriceFieldValue',
427 'type' => 'CheckBox',
432 'name' => 'is_active',
433 'type' => CRM_Utils_Type
::T_BOOLEAN
,
434 'title' => ts('Price Field Value is Active'),
435 'description' => ts('Is this price field value active'),
436 'where' => 'civicrm_price_field_value.is_active',
438 'table_name' => 'civicrm_price_field_value',
439 'entity' => 'PriceFieldValue',
440 'bao' => 'CRM_Price_BAO_PriceFieldValue',
444 'financial_type_id' => [
445 'name' => 'financial_type_id',
446 'type' => CRM_Utils_Type
::T_INT
,
447 'title' => ts('Financial Type'),
448 'description' => ts('FK to Financial Type.'),
449 'where' => 'civicrm_price_field_value.financial_type_id',
451 'table_name' => 'civicrm_price_field_value',
452 'entity' => 'PriceFieldValue',
453 'bao' => 'CRM_Price_BAO_PriceFieldValue',
455 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
459 'pseudoconstant' => [
460 'table' => 'civicrm_financial_type',
462 'labelColumn' => 'name',
466 'non_deductible_amount' => [
467 'name' => 'non_deductible_amount',
468 'type' => CRM_Utils_Type
::T_MONEY
,
469 'title' => ts('Non-deductible Amount'),
470 'description' => ts('Portion of total amount which is NOT tax deductible.'),
476 'where' => 'civicrm_price_field_value.non_deductible_amount',
477 'headerPattern' => '/non?.?deduct/i',
478 'dataPattern' => '/^\d+(\.\d{2})?$/',
480 'table_name' => 'civicrm_price_field_value',
481 'entity' => 'PriceFieldValue',
482 'bao' => 'CRM_Price_BAO_PriceFieldValue',
490 'name' => 'visibility_id',
491 'type' => CRM_Utils_Type
::T_INT
,
492 'title' => ts('Price Field Option Visibility'),
493 'description' => ts('Implicit FK to civicrm_option_group with name = \'visibility\''),
494 'where' => 'civicrm_price_field_value.visibility_id',
496 'table_name' => 'civicrm_price_field_value',
497 'entity' => 'PriceFieldValue',
498 'bao' => 'CRM_Price_BAO_PriceFieldValue',
503 'pseudoconstant' => [
504 'optionGroupName' => 'visibility',
505 'optionEditPath' => 'civicrm/admin/options/visibility',
510 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
512 return Civi
::$statics[__CLASS__
]['fields'];
516 * Return a mapping from field-name to the corresponding key (as used in fields()).
519 * Array(string $name => string $uniqueName).
521 public static function &fieldKeys() {
522 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
523 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
525 return Civi
::$statics[__CLASS__
]['fieldKeys'];
529 * Returns the names of this table
533 public static function getTableName() {
534 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
538 * Returns if this table needs to be logged
542 public function getLog() {
547 * Returns the list of fields that can be imported
549 * @param bool $prefix
553 public static function &import($prefix = FALSE) {
554 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_field_value', $prefix, []);
559 * Returns the list of fields that can be exported
561 * @param bool $prefix
565 public static function &export($prefix = FALSE) {
566 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_field_value', $prefix, []);
571 * Returns the list of indices
573 * @param bool $localize
577 public static function indices($localize = TRUE) {
579 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;