5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Price/PriceFieldValue.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:a3de204f039daa85984316fae2c60975)
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 static $_tableName = 'civicrm_price_field_value';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 'table_name' => 'civicrm_price_field_value',
197 'entity' => 'PriceFieldValue',
198 'bao' => 'CRM_Price_BAO_PriceFieldValue',
201 'price_field_id' => [
202 'name' => 'price_field_id',
203 'type' => CRM_Utils_Type
::T_INT
,
204 'title' => ts('Price Field'),
205 'description' => ts('FK to civicrm_price_field'),
207 'table_name' => 'civicrm_price_field_value',
208 'entity' => 'PriceFieldValue',
209 'bao' => 'CRM_Price_BAO_PriceFieldValue',
211 'FKClassName' => 'CRM_Price_DAO_PriceField',
215 'type' => CRM_Utils_Type
::T_STRING
,
216 'title' => ts('Name'),
217 'description' => ts('Price field option name'),
219 'size' => CRM_Utils_Type
::HUGE
,
220 'table_name' => 'civicrm_price_field_value',
221 'entity' => 'PriceFieldValue',
222 'bao' => 'CRM_Price_BAO_PriceFieldValue',
230 'type' => CRM_Utils_Type
::T_STRING
,
231 'title' => ts('Label'),
232 'description' => ts('Price field option label'),
234 'size' => CRM_Utils_Type
::HUGE
,
235 'table_name' => 'civicrm_price_field_value',
236 'entity' => 'PriceFieldValue',
237 'bao' => 'CRM_Price_BAO_PriceFieldValue',
244 'name' => 'description',
245 'type' => CRM_Utils_Type
::T_TEXT
,
246 'title' => ts('Description'),
247 'description' => ts('Price field option description.'),
251 'table_name' => 'civicrm_price_field_value',
252 'entity' => 'PriceFieldValue',
253 'bao' => 'CRM_Price_BAO_PriceFieldValue',
256 'type' => 'TextArea',
260 'name' => 'help_pre',
261 'type' => CRM_Utils_Type
::T_TEXT
,
262 'title' => ts('Help Pre'),
263 'description' => ts('Price field option pre help text.'),
267 'table_name' => 'civicrm_price_field_value',
268 'entity' => 'PriceFieldValue',
269 'bao' => 'CRM_Price_BAO_PriceFieldValue',
272 'type' => 'TextArea',
276 'name' => 'help_post',
277 'type' => CRM_Utils_Type
::T_TEXT
,
278 'title' => ts('Help Post'),
279 'description' => ts('Price field option post field help.'),
283 'table_name' => 'civicrm_price_field_value',
284 'entity' => 'PriceFieldValue',
285 'bao' => 'CRM_Price_BAO_PriceFieldValue',
288 'type' => 'TextArea',
293 'type' => CRM_Utils_Type
::T_MONEY
,
294 'title' => ts('Amount'),
295 'description' => ts('Price field option amount'),
301 'table_name' => 'civicrm_price_field_value',
302 'entity' => 'PriceFieldValue',
303 'bao' => 'CRM_Price_BAO_PriceFieldValue',
311 'type' => CRM_Utils_Type
::T_INT
,
312 'title' => ts('Count'),
313 'description' => ts('Number of participants per field option'),
315 'table_name' => 'civicrm_price_field_value',
316 'entity' => 'PriceFieldValue',
317 'bao' => 'CRM_Price_BAO_PriceFieldValue',
324 'name' => 'max_value',
325 'type' => CRM_Utils_Type
::T_INT
,
326 'title' => ts('Max Value'),
327 'description' => ts('Max number of participants per field options'),
329 'table_name' => 'civicrm_price_field_value',
330 'entity' => 'PriceFieldValue',
331 'bao' => 'CRM_Price_BAO_PriceFieldValue',
339 'type' => CRM_Utils_Type
::T_INT
,
340 'title' => ts('Order'),
341 'description' => ts('Order in which the field options should appear'),
343 'table_name' => 'civicrm_price_field_value',
344 'entity' => 'PriceFieldValue',
345 'bao' => 'CRM_Price_BAO_PriceFieldValue',
351 'membership_type_id' => [
352 'name' => 'membership_type_id',
353 'type' => CRM_Utils_Type
::T_INT
,
354 'title' => ts('Membership Type'),
355 'description' => ts('FK to Membership Type'),
357 'table_name' => 'civicrm_price_field_value',
358 'entity' => 'PriceFieldValue',
359 'bao' => 'CRM_Price_BAO_PriceFieldValue',
361 'FKClassName' => 'CRM_Member_DAO_MembershipType',
366 'membership_num_terms' => [
367 'name' => 'membership_num_terms',
368 'type' => CRM_Utils_Type
::T_INT
,
369 'title' => ts('Membership Num Terms'),
370 'description' => ts('Number of terms for this membership'),
372 'table_name' => 'civicrm_price_field_value',
373 'entity' => 'PriceFieldValue',
374 'bao' => 'CRM_Price_BAO_PriceFieldValue',
381 'name' => 'is_default',
382 'type' => CRM_Utils_Type
::T_BOOLEAN
,
383 'title' => ts('Is Default Price Field Option?'),
384 'description' => ts('Is this default price field option'),
386 'table_name' => 'civicrm_price_field_value',
387 'entity' => 'PriceFieldValue',
388 'bao' => 'CRM_Price_BAO_PriceFieldValue',
391 'type' => 'CheckBox',
395 'name' => 'is_active',
396 'type' => CRM_Utils_Type
::T_BOOLEAN
,
397 'title' => ts('Price Field Value is Active'),
398 'description' => ts('Is this price field value active'),
400 'table_name' => 'civicrm_price_field_value',
401 'entity' => 'PriceFieldValue',
402 'bao' => 'CRM_Price_BAO_PriceFieldValue',
405 'financial_type_id' => [
406 'name' => 'financial_type_id',
407 'type' => CRM_Utils_Type
::T_INT
,
408 'title' => ts('Financial Type'),
409 'description' => ts('FK to Financial Type.'),
411 'table_name' => 'civicrm_price_field_value',
412 'entity' => 'PriceFieldValue',
413 'bao' => 'CRM_Price_BAO_PriceFieldValue',
415 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
419 'pseudoconstant' => [
420 'table' => 'civicrm_financial_type',
422 'labelColumn' => 'name',
425 'non_deductible_amount' => [
426 'name' => 'non_deductible_amount',
427 'type' => CRM_Utils_Type
::T_MONEY
,
428 'title' => ts('Non-deductible Amount'),
429 'description' => ts('Portion of total amount which is NOT tax deductible.'),
436 'table_name' => 'civicrm_price_field_value',
437 'entity' => 'PriceFieldValue',
438 'bao' => 'CRM_Price_BAO_PriceFieldValue',
445 'name' => 'visibility_id',
446 'type' => CRM_Utils_Type
::T_INT
,
447 'title' => ts('Price Field Option Visibility'),
448 'description' => ts('Implicit FK to civicrm_option_group with name = \'visibility\''),
450 'table_name' => 'civicrm_price_field_value',
451 'entity' => 'PriceFieldValue',
452 'bao' => 'CRM_Price_BAO_PriceFieldValue',
457 'pseudoconstant' => [
458 'optionGroupName' => 'visibility',
459 'optionEditPath' => 'civicrm/admin/options/visibility',
463 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
465 return Civi
::$statics[__CLASS__
]['fields'];
469 * Return a mapping from field-name to the corresponding key (as used in fields()).
472 * Array(string $name => string $uniqueName).
474 public static function &fieldKeys() {
475 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
476 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
478 return Civi
::$statics[__CLASS__
]['fieldKeys'];
482 * Returns the names of this table
486 public static function getTableName() {
487 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
491 * Returns if this table needs to be logged
495 public function getLog() {
500 * Returns the list of fields that can be imported
502 * @param bool $prefix
506 public static function &import($prefix = FALSE) {
507 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_field_value', $prefix, []);
512 * Returns the list of fields that can be exported
514 * @param bool $prefix
518 public static function &export($prefix = FALSE) {
519 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_field_value', $prefix, []);
524 * Returns the list of indices
526 * @param bool $localize
530 public static function indices($localize = TRUE) {
532 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;