3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Price/PriceFieldValue.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:44b920e4a8091f16a96990834a24c288)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Price_DAO_PriceFieldValue constructor.
40 class CRM_Price_DAO_PriceFieldValue
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_price_field_value';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * FK to civicrm_price_field
64 public $price_field_id;
66 * Price field option name
72 * Price field option label
78 * >Price field option description.
84 * Price field option pre help text.
90 * Price field option post field help.
96 * Price field option amount
102 * Number of participants per field option
108 * Max number of participants per field options
114 * Order in which the field options should appear
120 * FK to Membership Type
124 public $membership_type_id;
126 * Number of terms for this membership
130 public $membership_num_terms;
132 * Is this default price field option
138 * Is this price field value active
144 * FK to Financial Type.
148 public $financial_type_id;
150 * Portion of total amount which is NOT tax deductible.
154 public $non_deductible_amount;
156 * Implicit FK to civicrm_option_group with name = \'visibility\'
160 public $visibility_id;
164 function __construct() {
165 $this->__table
= 'civicrm_price_field_value';
166 parent
::__construct();
169 * Returns foreign keys and entity references.
172 * [CRM_Core_Reference_Interface]
174 static function getReferenceColumns() {
175 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
176 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
177 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'price_field_id', 'civicrm_price_field', 'id');
178 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'membership_type_id', 'civicrm_membership_type', 'id');
179 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
180 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
182 return Civi
::$statics[__CLASS__
]['links'];
185 * Returns all the column names of this table
189 static function &fields() {
190 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
191 Civi
::$statics[__CLASS__
]['fields'] = array(
194 'type' => CRM_Utils_Type
::T_INT
,
195 'title' => ts('Price Field Value ID') ,
196 'description' => 'Price Field Value',
198 'table_name' => 'civicrm_price_field_value',
199 'entity' => 'PriceFieldValue',
200 'bao' => 'CRM_Price_BAO_PriceFieldValue',
203 'price_field_id' => array(
204 'name' => 'price_field_id',
205 'type' => CRM_Utils_Type
::T_INT
,
206 'title' => ts('Price Field') ,
207 'description' => 'FK to civicrm_price_field',
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' => 'Price field option name',
221 'size' => CRM_Utils_Type
::HUGE
,
222 'table_name' => 'civicrm_price_field_value',
223 'entity' => 'PriceFieldValue',
224 'bao' => 'CRM_Price_BAO_PriceFieldValue',
232 'type' => CRM_Utils_Type
::T_STRING
,
233 'title' => ts('Label') ,
234 'description' => 'Price field option label',
236 'size' => CRM_Utils_Type
::HUGE
,
237 'table_name' => 'civicrm_price_field_value',
238 'entity' => 'PriceFieldValue',
239 'bao' => 'CRM_Price_BAO_PriceFieldValue',
245 'description' => array(
246 'name' => 'description',
247 'type' => CRM_Utils_Type
::T_TEXT
,
248 'title' => ts('Description') ,
249 'description' => '>Price field option description.',
253 'table_name' => 'civicrm_price_field_value',
254 'entity' => 'PriceFieldValue',
255 'bao' => 'CRM_Price_BAO_PriceFieldValue',
258 'type' => 'TextArea',
262 'name' => 'help_pre',
263 'type' => CRM_Utils_Type
::T_TEXT
,
264 'title' => ts('Help Pre') ,
265 'description' => 'Price field option pre help text.',
269 'table_name' => 'civicrm_price_field_value',
270 'entity' => 'PriceFieldValue',
271 'bao' => 'CRM_Price_BAO_PriceFieldValue',
274 'type' => 'TextArea',
277 'help_post' => array(
278 'name' => 'help_post',
279 'type' => CRM_Utils_Type
::T_TEXT
,
280 'title' => ts('Help Post') ,
281 'description' => 'Price field option post field help.',
285 'table_name' => 'civicrm_price_field_value',
286 'entity' => 'PriceFieldValue',
287 'bao' => 'CRM_Price_BAO_PriceFieldValue',
290 'type' => 'TextArea',
295 'type' => CRM_Utils_Type
::T_STRING
,
296 'title' => ts('Amount') ,
297 'description' => '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' => 'Number of participants per field option',
315 'table_name' => 'civicrm_price_field_value',
316 'entity' => 'PriceFieldValue',
317 'bao' => 'CRM_Price_BAO_PriceFieldValue',
323 'max_value' => array(
324 'name' => 'max_value',
325 'type' => CRM_Utils_Type
::T_INT
,
326 'title' => ts('Max Value') ,
327 'description' => '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' => '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' => array(
352 'name' => 'membership_type_id',
353 'type' => CRM_Utils_Type
::T_INT
,
354 'title' => ts('Membership Type') ,
355 'description' => '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' => array(
367 'name' => 'membership_num_terms',
368 'type' => CRM_Utils_Type
::T_INT
,
369 'title' => ts('Membership Num Terms') ,
370 'description' => 'Number of terms for this membership',
372 'table_name' => 'civicrm_price_field_value',
373 'entity' => 'PriceFieldValue',
374 'bao' => 'CRM_Price_BAO_PriceFieldValue',
380 'is_default' => array(
381 'name' => 'is_default',
382 'type' => CRM_Utils_Type
::T_BOOLEAN
,
383 'title' => ts('Is Default Price Field Option?') ,
384 'description' => 'Is this default price field option',
385 'table_name' => 'civicrm_price_field_value',
386 'entity' => 'PriceFieldValue',
387 'bao' => 'CRM_Price_BAO_PriceFieldValue',
390 'type' => 'CheckBox',
393 'is_active' => array(
394 'name' => 'is_active',
395 'type' => CRM_Utils_Type
::T_BOOLEAN
,
396 'title' => ts('Price Field Value is Active') ,
397 'description' => 'Is this price field value active',
399 'table_name' => 'civicrm_price_field_value',
400 'entity' => 'PriceFieldValue',
401 'bao' => 'CRM_Price_BAO_PriceFieldValue',
404 'financial_type_id' => array(
405 'name' => 'financial_type_id',
406 'type' => CRM_Utils_Type
::T_INT
,
407 'title' => ts('Financial Type') ,
408 'description' => 'FK to Financial Type.',
410 'table_name' => 'civicrm_price_field_value',
411 'entity' => 'PriceFieldValue',
412 'bao' => 'CRM_Price_BAO_PriceFieldValue',
414 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
418 'pseudoconstant' => array(
419 'table' => 'civicrm_financial_type',
421 'labelColumn' => 'name',
424 'non_deductible_amount' => array(
425 'name' => 'non_deductible_amount',
426 'type' => CRM_Utils_Type
::T_MONEY
,
427 'title' => ts('Non-deductible Amount') ,
428 'description' => 'Portion of total amount which is NOT tax deductible.',
430 'precision' => array(
435 'table_name' => 'civicrm_price_field_value',
436 'entity' => 'PriceFieldValue',
437 'bao' => 'CRM_Price_BAO_PriceFieldValue',
443 'visibility_id' => array(
444 'name' => 'visibility_id',
445 'type' => CRM_Utils_Type
::T_INT
,
446 'title' => ts('Price Field Option Visibility') ,
447 'description' => 'Implicit FK to civicrm_option_group with name = \'visibility\'',
449 'table_name' => 'civicrm_price_field_value',
450 'entity' => 'PriceFieldValue',
451 'bao' => 'CRM_Price_BAO_PriceFieldValue',
456 'pseudoconstant' => array(
457 'optionGroupName' => 'visibility',
458 'optionEditPath' => 'civicrm/admin/options/visibility',
462 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
464 return Civi
::$statics[__CLASS__
]['fields'];
467 * Return a mapping from field-name to the corresponding key (as used in fields()).
470 * Array(string $name => string $uniqueName).
472 static function &fieldKeys() {
473 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
474 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
476 return Civi
::$statics[__CLASS__
]['fieldKeys'];
479 * Returns the names of this table
483 static function getTableName() {
484 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
487 * Returns if this table needs to be logged
495 * Returns the list of fields that can be imported
497 * @param bool $prefix
501 static function &import($prefix = false) {
502 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_field_value', $prefix, array());
506 * Returns the list of fields that can be exported
508 * @param bool $prefix
512 static function &export($prefix = false) {
513 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_field_value', $prefix, array());
517 * Returns the list of indices
519 public static function indices($localize = TRUE) {
521 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;