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:6c2bd575335eeb9915683296952b2c3e)
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'),
221 'size' => CRM_Utils_Type
::HUGE
,
222 'where' => 'civicrm_price_field_value.name',
223 'table_name' => 'civicrm_price_field_value',
224 'entity' => 'PriceFieldValue',
225 'bao' => 'CRM_Price_BAO_PriceFieldValue',
233 'type' => CRM_Utils_Type
::T_STRING
,
234 'title' => ts('Label'),
235 'description' => ts('Price field option label'),
237 'size' => CRM_Utils_Type
::HUGE
,
238 'where' => 'civicrm_price_field_value.label',
239 'table_name' => 'civicrm_price_field_value',
240 'entity' => 'PriceFieldValue',
241 'bao' => 'CRM_Price_BAO_PriceFieldValue',
248 'name' => 'description',
249 'type' => CRM_Utils_Type
::T_TEXT
,
250 'title' => ts('Description'),
251 'description' => ts('Price field option description.'),
254 'where' => 'civicrm_price_field_value.description',
256 'table_name' => 'civicrm_price_field_value',
257 'entity' => 'PriceFieldValue',
258 'bao' => 'CRM_Price_BAO_PriceFieldValue',
261 'type' => 'TextArea',
265 'name' => 'help_pre',
266 'type' => CRM_Utils_Type
::T_TEXT
,
267 'title' => ts('Help Pre'),
268 'description' => ts('Price field option pre help text.'),
271 'where' => 'civicrm_price_field_value.help_pre',
273 'table_name' => 'civicrm_price_field_value',
274 'entity' => 'PriceFieldValue',
275 'bao' => 'CRM_Price_BAO_PriceFieldValue',
278 'type' => 'TextArea',
282 'name' => 'help_post',
283 'type' => CRM_Utils_Type
::T_TEXT
,
284 'title' => ts('Help Post'),
285 'description' => ts('Price field option post field help.'),
288 'where' => 'civicrm_price_field_value.help_post',
290 'table_name' => 'civicrm_price_field_value',
291 'entity' => 'PriceFieldValue',
292 'bao' => 'CRM_Price_BAO_PriceFieldValue',
295 'type' => 'TextArea',
300 'type' => CRM_Utils_Type
::T_MONEY
,
301 'title' => ts('Amount'),
302 'description' => ts('Price field option amount'),
308 'where' => 'civicrm_price_field_value.amount',
309 'table_name' => 'civicrm_price_field_value',
310 'entity' => 'PriceFieldValue',
311 'bao' => 'CRM_Price_BAO_PriceFieldValue',
319 'type' => CRM_Utils_Type
::T_INT
,
320 'title' => ts('Count'),
321 'description' => ts('Number of participants per field option'),
322 'where' => 'civicrm_price_field_value.count',
324 'table_name' => 'civicrm_price_field_value',
325 'entity' => 'PriceFieldValue',
326 'bao' => 'CRM_Price_BAO_PriceFieldValue',
333 'name' => 'max_value',
334 'type' => CRM_Utils_Type
::T_INT
,
335 'title' => ts('Max Value'),
336 'description' => ts('Max number of participants per field options'),
337 'where' => 'civicrm_price_field_value.max_value',
339 'table_name' => 'civicrm_price_field_value',
340 'entity' => 'PriceFieldValue',
341 'bao' => 'CRM_Price_BAO_PriceFieldValue',
349 'type' => CRM_Utils_Type
::T_INT
,
350 'title' => ts('Order'),
351 'description' => ts('Order in which the field options should appear'),
352 'where' => 'civicrm_price_field_value.weight',
354 'table_name' => 'civicrm_price_field_value',
355 'entity' => 'PriceFieldValue',
356 'bao' => 'CRM_Price_BAO_PriceFieldValue',
362 'membership_type_id' => [
363 'name' => 'membership_type_id',
364 'type' => CRM_Utils_Type
::T_INT
,
365 'title' => ts('Membership Type'),
366 'description' => ts('FK to Membership Type'),
367 'where' => 'civicrm_price_field_value.membership_type_id',
369 'table_name' => 'civicrm_price_field_value',
370 'entity' => 'PriceFieldValue',
371 'bao' => 'CRM_Price_BAO_PriceFieldValue',
373 'FKClassName' => 'CRM_Member_DAO_MembershipType',
378 'membership_num_terms' => [
379 'name' => 'membership_num_terms',
380 'type' => CRM_Utils_Type
::T_INT
,
381 'title' => ts('Membership Num Terms'),
382 'description' => ts('Number of terms for this membership'),
383 'where' => 'civicrm_price_field_value.membership_num_terms',
385 'table_name' => 'civicrm_price_field_value',
386 'entity' => 'PriceFieldValue',
387 'bao' => 'CRM_Price_BAO_PriceFieldValue',
394 'name' => 'is_default',
395 'type' => CRM_Utils_Type
::T_BOOLEAN
,
396 'title' => ts('Is Default Price Field Option?'),
397 'description' => ts('Is this default price field option'),
398 'where' => 'civicrm_price_field_value.is_default',
400 'table_name' => 'civicrm_price_field_value',
401 'entity' => 'PriceFieldValue',
402 'bao' => 'CRM_Price_BAO_PriceFieldValue',
405 'type' => 'CheckBox',
409 'name' => 'is_active',
410 'type' => CRM_Utils_Type
::T_BOOLEAN
,
411 'title' => ts('Price Field Value is Active'),
412 'description' => ts('Is this price field value active'),
413 'where' => 'civicrm_price_field_value.is_active',
415 'table_name' => 'civicrm_price_field_value',
416 'entity' => 'PriceFieldValue',
417 'bao' => 'CRM_Price_BAO_PriceFieldValue',
420 'financial_type_id' => [
421 'name' => 'financial_type_id',
422 'type' => CRM_Utils_Type
::T_INT
,
423 'title' => ts('Financial Type'),
424 'description' => ts('FK to Financial Type.'),
425 'where' => 'civicrm_price_field_value.financial_type_id',
427 'table_name' => 'civicrm_price_field_value',
428 'entity' => 'PriceFieldValue',
429 'bao' => 'CRM_Price_BAO_PriceFieldValue',
431 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
435 'pseudoconstant' => [
436 'table' => 'civicrm_financial_type',
438 'labelColumn' => 'name',
441 'non_deductible_amount' => [
442 'name' => 'non_deductible_amount',
443 'type' => CRM_Utils_Type
::T_MONEY
,
444 'title' => ts('Non-deductible Amount'),
445 'description' => ts('Portion of total amount which is NOT tax deductible.'),
451 'where' => 'civicrm_price_field_value.non_deductible_amount',
452 'headerPattern' => '/non?.?deduct/i',
453 'dataPattern' => '/^\d+(\.\d{2})?$/',
455 'table_name' => 'civicrm_price_field_value',
456 'entity' => 'PriceFieldValue',
457 'bao' => 'CRM_Price_BAO_PriceFieldValue',
464 'name' => 'visibility_id',
465 'type' => CRM_Utils_Type
::T_INT
,
466 'title' => ts('Price Field Option Visibility'),
467 'description' => ts('Implicit FK to civicrm_option_group with name = \'visibility\''),
468 'where' => 'civicrm_price_field_value.visibility_id',
470 'table_name' => 'civicrm_price_field_value',
471 'entity' => 'PriceFieldValue',
472 'bao' => 'CRM_Price_BAO_PriceFieldValue',
477 'pseudoconstant' => [
478 'optionGroupName' => 'visibility',
479 'optionEditPath' => 'civicrm/admin/options/visibility',
483 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
485 return Civi
::$statics[__CLASS__
]['fields'];
489 * Return a mapping from field-name to the corresponding key (as used in fields()).
492 * Array(string $name => string $uniqueName).
494 public static function &fieldKeys() {
495 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
496 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
498 return Civi
::$statics[__CLASS__
]['fieldKeys'];
502 * Returns the names of this table
506 public static function getTableName() {
507 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
511 * Returns if this table needs to be logged
515 public function getLog() {
520 * Returns the list of fields that can be imported
522 * @param bool $prefix
526 public static function &import($prefix = FALSE) {
527 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_field_value', $prefix, []);
532 * Returns the list of fields that can be exported
534 * @param bool $prefix
538 public static function &export($prefix = FALSE) {
539 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_field_value', $prefix, []);
544 * Returns the list of indices
546 * @param bool $localize
550 public static function indices($localize = TRUE) {
552 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;