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:fed218269d1baab495490130b4e2442a)
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_MONEY
,
296 'title' => ts('Amount') ,
297 'description' => 'Price field option amount',
299 'precision' => array(
303 'table_name' => 'civicrm_price_field_value',
304 'entity' => 'PriceFieldValue',
305 'bao' => 'CRM_Price_BAO_PriceFieldValue',
313 'type' => CRM_Utils_Type
::T_INT
,
314 'title' => ts('Count') ,
315 'description' => 'Number of participants per field option',
317 'table_name' => 'civicrm_price_field_value',
318 'entity' => 'PriceFieldValue',
319 'bao' => 'CRM_Price_BAO_PriceFieldValue',
325 'max_value' => array(
326 'name' => 'max_value',
327 'type' => CRM_Utils_Type
::T_INT
,
328 'title' => ts('Max Value') ,
329 'description' => 'Max number of participants per field options',
331 'table_name' => 'civicrm_price_field_value',
332 'entity' => 'PriceFieldValue',
333 'bao' => 'CRM_Price_BAO_PriceFieldValue',
341 'type' => CRM_Utils_Type
::T_INT
,
342 'title' => ts('Order') ,
343 'description' => 'Order in which the field options should appear',
345 'table_name' => 'civicrm_price_field_value',
346 'entity' => 'PriceFieldValue',
347 'bao' => 'CRM_Price_BAO_PriceFieldValue',
353 'membership_type_id' => array(
354 'name' => 'membership_type_id',
355 'type' => CRM_Utils_Type
::T_INT
,
356 'title' => ts('Membership Type') ,
357 'description' => 'FK to Membership Type',
359 'table_name' => 'civicrm_price_field_value',
360 'entity' => 'PriceFieldValue',
361 'bao' => 'CRM_Price_BAO_PriceFieldValue',
363 'FKClassName' => 'CRM_Member_DAO_MembershipType',
368 'membership_num_terms' => array(
369 'name' => 'membership_num_terms',
370 'type' => CRM_Utils_Type
::T_INT
,
371 'title' => ts('Membership Num Terms') ,
372 'description' => 'Number of terms for this membership',
374 'table_name' => 'civicrm_price_field_value',
375 'entity' => 'PriceFieldValue',
376 'bao' => 'CRM_Price_BAO_PriceFieldValue',
382 'is_default' => array(
383 'name' => 'is_default',
384 'type' => CRM_Utils_Type
::T_BOOLEAN
,
385 'title' => ts('Is Default Price Field Option?') ,
386 'description' => 'Is this default price field option',
387 'table_name' => 'civicrm_price_field_value',
388 'entity' => 'PriceFieldValue',
389 'bao' => 'CRM_Price_BAO_PriceFieldValue',
392 'type' => 'CheckBox',
395 'is_active' => array(
396 'name' => 'is_active',
397 'type' => CRM_Utils_Type
::T_BOOLEAN
,
398 'title' => ts('Price Field Value is Active') ,
399 'description' => 'Is this price field value active',
401 'table_name' => 'civicrm_price_field_value',
402 'entity' => 'PriceFieldValue',
403 'bao' => 'CRM_Price_BAO_PriceFieldValue',
406 'financial_type_id' => array(
407 'name' => 'financial_type_id',
408 'type' => CRM_Utils_Type
::T_INT
,
409 'title' => ts('Financial Type') ,
410 'description' => 'FK to Financial Type.',
412 'table_name' => 'civicrm_price_field_value',
413 'entity' => 'PriceFieldValue',
414 'bao' => 'CRM_Price_BAO_PriceFieldValue',
416 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
420 'pseudoconstant' => array(
421 'table' => 'civicrm_financial_type',
423 'labelColumn' => 'name',
426 'non_deductible_amount' => array(
427 'name' => 'non_deductible_amount',
428 'type' => CRM_Utils_Type
::T_MONEY
,
429 'title' => ts('Non-deductible Amount') ,
430 'description' => 'Portion of total amount which is NOT tax deductible.',
432 'precision' => array(
437 'table_name' => 'civicrm_price_field_value',
438 'entity' => 'PriceFieldValue',
439 'bao' => 'CRM_Price_BAO_PriceFieldValue',
445 'visibility_id' => array(
446 'name' => 'visibility_id',
447 'type' => CRM_Utils_Type
::T_INT
,
448 'title' => ts('Price Field Option Visibility') ,
449 'description' => 'Implicit FK to civicrm_option_group with name = \'visibility\'',
451 'table_name' => 'civicrm_price_field_value',
452 'entity' => 'PriceFieldValue',
453 'bao' => 'CRM_Price_BAO_PriceFieldValue',
458 'pseudoconstant' => array(
459 'optionGroupName' => 'visibility',
460 'optionEditPath' => 'civicrm/admin/options/visibility',
464 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
466 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 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'];
481 * Returns the names of this table
485 static function getTableName() {
486 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
489 * Returns if this table needs to be logged
497 * Returns the list of fields that can be imported
499 * @param bool $prefix
503 static function &import($prefix = false) {
504 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_field_value', $prefix, array());
508 * Returns the list of fields that can be exported
510 * @param bool $prefix
514 static function &export($prefix = false) {
515 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_field_value', $prefix, array());
519 * Returns the list of indices
521 public static function indices($localize = TRUE) {
523 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;