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:47c904125e3421dde14b5fcd9b8a6f16)
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 foreign keys and entity references.
169 * [CRM_Core_Reference_Interface]
171 public static function getReferenceColumns() {
172 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
173 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
174 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'price_field_id', 'civicrm_price_field', 'id');
175 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'membership_type_id', 'civicrm_membership_type', 'id');
176 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'financial_type_id', 'civicrm_financial_type', 'id');
177 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
179 return Civi
::$statics[__CLASS__
]['links'];
183 * Returns all the column names of this table
187 public static function &fields() {
188 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
189 Civi
::$statics[__CLASS__
]['fields'] = [
192 'type' => CRM_Utils_Type
::T_INT
,
193 'title' => ts('Price Field Value ID'),
194 'description' => ts('Price Field Value'),
196 'where' => 'civicrm_price_field_value.id',
197 'table_name' => 'civicrm_price_field_value',
198 'entity' => 'PriceFieldValue',
199 'bao' => 'CRM_Price_BAO_PriceFieldValue',
202 'price_field_id' => [
203 'name' => 'price_field_id',
204 'type' => CRM_Utils_Type
::T_INT
,
205 'title' => ts('Price Field'),
206 'description' => ts('FK to civicrm_price_field'),
208 'where' => 'civicrm_price_field_value.price_field_id',
209 'table_name' => 'civicrm_price_field_value',
210 'entity' => 'PriceFieldValue',
211 'bao' => 'CRM_Price_BAO_PriceFieldValue',
213 'FKClassName' => 'CRM_Price_DAO_PriceField',
217 'type' => CRM_Utils_Type
::T_STRING
,
218 'title' => ts('Name'),
219 'description' => ts('Price field option name'),
222 'size' => CRM_Utils_Type
::HUGE
,
223 'where' => 'civicrm_price_field_value.name',
224 'table_name' => 'civicrm_price_field_value',
225 'entity' => 'PriceFieldValue',
226 'bao' => 'CRM_Price_BAO_PriceFieldValue',
234 'type' => CRM_Utils_Type
::T_STRING
,
235 'title' => ts('Label'),
236 'description' => ts('Price field option label'),
239 'size' => CRM_Utils_Type
::HUGE
,
240 'where' => 'civicrm_price_field_value.label',
241 'table_name' => 'civicrm_price_field_value',
242 'entity' => 'PriceFieldValue',
243 'bao' => 'CRM_Price_BAO_PriceFieldValue',
250 'name' => 'description',
251 'type' => CRM_Utils_Type
::T_TEXT
,
252 'title' => ts('Description'),
253 'description' => ts('Price field option description.'),
256 'where' => 'civicrm_price_field_value.description',
258 'table_name' => 'civicrm_price_field_value',
259 'entity' => 'PriceFieldValue',
260 'bao' => 'CRM_Price_BAO_PriceFieldValue',
263 'type' => 'TextArea',
267 'name' => 'help_pre',
268 'type' => CRM_Utils_Type
::T_TEXT
,
269 'title' => ts('Help Pre'),
270 'description' => ts('Price field option pre help text.'),
273 'where' => 'civicrm_price_field_value.help_pre',
275 'table_name' => 'civicrm_price_field_value',
276 'entity' => 'PriceFieldValue',
277 'bao' => 'CRM_Price_BAO_PriceFieldValue',
280 'type' => 'TextArea',
284 'name' => 'help_post',
285 'type' => CRM_Utils_Type
::T_TEXT
,
286 'title' => ts('Help Post'),
287 'description' => ts('Price field option post field help.'),
290 'where' => 'civicrm_price_field_value.help_post',
292 'table_name' => 'civicrm_price_field_value',
293 'entity' => 'PriceFieldValue',
294 'bao' => 'CRM_Price_BAO_PriceFieldValue',
297 'type' => 'TextArea',
302 'type' => CRM_Utils_Type
::T_MONEY
,
303 'title' => ts('Amount'),
304 'description' => ts('Price field option amount'),
310 'where' => 'civicrm_price_field_value.amount',
311 'table_name' => 'civicrm_price_field_value',
312 'entity' => 'PriceFieldValue',
313 'bao' => 'CRM_Price_BAO_PriceFieldValue',
321 'type' => CRM_Utils_Type
::T_INT
,
322 'title' => ts('Count'),
323 'description' => ts('Number of participants per field option'),
324 'where' => 'civicrm_price_field_value.count',
326 'table_name' => 'civicrm_price_field_value',
327 'entity' => 'PriceFieldValue',
328 'bao' => 'CRM_Price_BAO_PriceFieldValue',
335 'name' => 'max_value',
336 'type' => CRM_Utils_Type
::T_INT
,
337 'title' => ts('Max Value'),
338 'description' => ts('Max number of participants per field options'),
339 'where' => 'civicrm_price_field_value.max_value',
341 'table_name' => 'civicrm_price_field_value',
342 'entity' => 'PriceFieldValue',
343 'bao' => 'CRM_Price_BAO_PriceFieldValue',
351 'type' => CRM_Utils_Type
::T_INT
,
352 'title' => ts('Order'),
353 'description' => ts('Order in which the field options should appear'),
354 'where' => 'civicrm_price_field_value.weight',
356 'table_name' => 'civicrm_price_field_value',
357 'entity' => 'PriceFieldValue',
358 'bao' => 'CRM_Price_BAO_PriceFieldValue',
364 'membership_type_id' => [
365 'name' => 'membership_type_id',
366 'type' => CRM_Utils_Type
::T_INT
,
367 'title' => ts('Membership Type'),
368 'description' => ts('FK to Membership Type'),
369 'where' => 'civicrm_price_field_value.membership_type_id',
371 'table_name' => 'civicrm_price_field_value',
372 'entity' => 'PriceFieldValue',
373 'bao' => 'CRM_Price_BAO_PriceFieldValue',
375 'FKClassName' => 'CRM_Member_DAO_MembershipType',
380 'membership_num_terms' => [
381 'name' => 'membership_num_terms',
382 'type' => CRM_Utils_Type
::T_INT
,
383 'title' => ts('Membership Num Terms'),
384 'description' => ts('Number of terms for this membership'),
385 'where' => 'civicrm_price_field_value.membership_num_terms',
387 'table_name' => 'civicrm_price_field_value',
388 'entity' => 'PriceFieldValue',
389 'bao' => 'CRM_Price_BAO_PriceFieldValue',
396 'name' => 'is_default',
397 'type' => CRM_Utils_Type
::T_BOOLEAN
,
398 'title' => ts('Is Default Price Field Option?'),
399 'description' => ts('Is this default price field option'),
400 'where' => 'civicrm_price_field_value.is_default',
402 'table_name' => 'civicrm_price_field_value',
403 'entity' => 'PriceFieldValue',
404 'bao' => 'CRM_Price_BAO_PriceFieldValue',
407 'type' => 'CheckBox',
411 'name' => 'is_active',
412 'type' => CRM_Utils_Type
::T_BOOLEAN
,
413 'title' => ts('Price Field Value is Active'),
414 'description' => ts('Is this price field value active'),
415 'where' => 'civicrm_price_field_value.is_active',
417 'table_name' => 'civicrm_price_field_value',
418 'entity' => 'PriceFieldValue',
419 'bao' => 'CRM_Price_BAO_PriceFieldValue',
422 'financial_type_id' => [
423 'name' => 'financial_type_id',
424 'type' => CRM_Utils_Type
::T_INT
,
425 'title' => ts('Financial Type'),
426 'description' => ts('FK to Financial Type.'),
427 'where' => 'civicrm_price_field_value.financial_type_id',
429 'table_name' => 'civicrm_price_field_value',
430 'entity' => 'PriceFieldValue',
431 'bao' => 'CRM_Price_BAO_PriceFieldValue',
433 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
437 'pseudoconstant' => [
438 'table' => 'civicrm_financial_type',
440 'labelColumn' => 'name',
443 'non_deductible_amount' => [
444 'name' => 'non_deductible_amount',
445 'type' => CRM_Utils_Type
::T_MONEY
,
446 'title' => ts('Non-deductible Amount'),
447 'description' => ts('Portion of total amount which is NOT tax deductible.'),
453 'where' => 'civicrm_price_field_value.non_deductible_amount',
454 'headerPattern' => '/non?.?deduct/i',
455 'dataPattern' => '/^\d+(\.\d{2})?$/',
457 'table_name' => 'civicrm_price_field_value',
458 'entity' => 'PriceFieldValue',
459 'bao' => 'CRM_Price_BAO_PriceFieldValue',
466 'name' => 'visibility_id',
467 'type' => CRM_Utils_Type
::T_INT
,
468 'title' => ts('Price Field Option Visibility'),
469 'description' => ts('Implicit FK to civicrm_option_group with name = \'visibility\''),
470 'where' => 'civicrm_price_field_value.visibility_id',
472 'table_name' => 'civicrm_price_field_value',
473 'entity' => 'PriceFieldValue',
474 'bao' => 'CRM_Price_BAO_PriceFieldValue',
479 'pseudoconstant' => [
480 'optionGroupName' => 'visibility',
481 'optionEditPath' => 'civicrm/admin/options/visibility',
485 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
487 return Civi
::$statics[__CLASS__
]['fields'];
491 * Return a mapping from field-name to the corresponding key (as used in fields()).
494 * Array(string $name => string $uniqueName).
496 public static function &fieldKeys() {
497 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
498 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
500 return Civi
::$statics[__CLASS__
]['fieldKeys'];
504 * Returns the names of this table
508 public static function getTableName() {
509 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
513 * Returns if this table needs to be logged
517 public function getLog() {
522 * Returns the list of fields that can be imported
524 * @param bool $prefix
528 public static function &import($prefix = FALSE) {
529 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_field_value', $prefix, []);
534 * Returns the list of fields that can be exported
536 * @param bool $prefix
540 public static function &export($prefix = FALSE) {
541 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_field_value', $prefix, []);
546 * Returns the list of indices
548 * @param bool $localize
552 public static function indices($localize = TRUE) {
554 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;