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;
158 function __construct() {
159 $this->__table
= 'civicrm_price_field_value';
160 parent
::__construct();
163 * Returns foreign keys and entity references.
166 * [CRM_Core_Reference_Interface]
168 static function getReferenceColumns() {
169 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
170 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
171 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'price_field_id', 'civicrm_price_field', 'id');
172 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'membership_type_id', 'civicrm_membership_type', 'id');
173 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
174 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
176 return Civi
::$statics[__CLASS__
]['links'];
179 * Returns all the column names of this table
183 static function &fields() {
184 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
185 Civi
::$statics[__CLASS__
]['fields'] = array(
188 'type' => CRM_Utils_Type
::T_INT
,
189 'title' => ts('Price Field Value ID') ,
190 'description' => 'Price Field Value',
192 'table_name' => 'civicrm_price_field_value',
193 'entity' => 'PriceFieldValue',
194 'bao' => 'CRM_Price_BAO_PriceFieldValue',
197 'price_field_id' => array(
198 'name' => 'price_field_id',
199 'type' => CRM_Utils_Type
::T_INT
,
200 'title' => ts('Price Field') ,
201 'description' => 'FK to civicrm_price_field',
203 'table_name' => 'civicrm_price_field_value',
204 'entity' => 'PriceFieldValue',
205 'bao' => 'CRM_Price_BAO_PriceFieldValue',
207 'FKClassName' => 'CRM_Price_DAO_PriceField',
211 'type' => CRM_Utils_Type
::T_STRING
,
212 'title' => ts('Name') ,
213 'description' => 'Price field option name',
215 'size' => CRM_Utils_Type
::HUGE
,
216 'table_name' => 'civicrm_price_field_value',
217 'entity' => 'PriceFieldValue',
218 'bao' => 'CRM_Price_BAO_PriceFieldValue',
226 'type' => CRM_Utils_Type
::T_STRING
,
227 'title' => ts('Label') ,
228 'description' => 'Price field option label',
230 'size' => CRM_Utils_Type
::HUGE
,
231 'table_name' => 'civicrm_price_field_value',
232 'entity' => 'PriceFieldValue',
233 'bao' => 'CRM_Price_BAO_PriceFieldValue',
239 'description' => array(
240 'name' => 'description',
241 'type' => CRM_Utils_Type
::T_TEXT
,
242 'title' => ts('Description') ,
243 'description' => '>Price field option description.',
247 'table_name' => 'civicrm_price_field_value',
248 'entity' => 'PriceFieldValue',
249 'bao' => 'CRM_Price_BAO_PriceFieldValue',
252 'type' => 'TextArea',
256 'name' => 'help_pre',
257 'type' => CRM_Utils_Type
::T_TEXT
,
258 'title' => ts('Help Pre') ,
259 'description' => 'Price field option pre help text.',
263 'table_name' => 'civicrm_price_field_value',
264 'entity' => 'PriceFieldValue',
265 'bao' => 'CRM_Price_BAO_PriceFieldValue',
268 'type' => 'TextArea',
271 'help_post' => array(
272 'name' => 'help_post',
273 'type' => CRM_Utils_Type
::T_TEXT
,
274 'title' => ts('Help Post') ,
275 'description' => 'Price field option post field help.',
279 'table_name' => 'civicrm_price_field_value',
280 'entity' => 'PriceFieldValue',
281 'bao' => 'CRM_Price_BAO_PriceFieldValue',
284 'type' => 'TextArea',
289 'type' => CRM_Utils_Type
::T_STRING
,
290 'title' => ts('Amount') ,
291 'description' => 'Price field option amount',
295 'table_name' => 'civicrm_price_field_value',
296 'entity' => 'PriceFieldValue',
297 'bao' => 'CRM_Price_BAO_PriceFieldValue',
305 'type' => CRM_Utils_Type
::T_INT
,
306 'title' => ts('Count') ,
307 'description' => 'Number of participants per field option',
309 'table_name' => 'civicrm_price_field_value',
310 'entity' => 'PriceFieldValue',
311 'bao' => 'CRM_Price_BAO_PriceFieldValue',
317 'max_value' => array(
318 'name' => 'max_value',
319 'type' => CRM_Utils_Type
::T_INT
,
320 'title' => ts('Max Value') ,
321 'description' => 'Max number of participants per field options',
323 'table_name' => 'civicrm_price_field_value',
324 'entity' => 'PriceFieldValue',
325 'bao' => 'CRM_Price_BAO_PriceFieldValue',
333 'type' => CRM_Utils_Type
::T_INT
,
334 'title' => ts('Order') ,
335 'description' => 'Order in which the field options should appear',
337 'table_name' => 'civicrm_price_field_value',
338 'entity' => 'PriceFieldValue',
339 'bao' => 'CRM_Price_BAO_PriceFieldValue',
345 'membership_type_id' => array(
346 'name' => 'membership_type_id',
347 'type' => CRM_Utils_Type
::T_INT
,
348 'title' => ts('Membership Type') ,
349 'description' => 'FK to Membership Type',
351 'table_name' => 'civicrm_price_field_value',
352 'entity' => 'PriceFieldValue',
353 'bao' => 'CRM_Price_BAO_PriceFieldValue',
355 'FKClassName' => 'CRM_Member_DAO_MembershipType',
360 'membership_num_terms' => array(
361 'name' => 'membership_num_terms',
362 'type' => CRM_Utils_Type
::T_INT
,
363 'title' => ts('Membership Num Terms') ,
364 'description' => 'Number of terms for this membership',
366 'table_name' => 'civicrm_price_field_value',
367 'entity' => 'PriceFieldValue',
368 'bao' => 'CRM_Price_BAO_PriceFieldValue',
374 'is_default' => array(
375 'name' => 'is_default',
376 'type' => CRM_Utils_Type
::T_BOOLEAN
,
377 'title' => ts('Is Default Price Field Option?') ,
378 'description' => 'Is this default price field option',
379 'table_name' => 'civicrm_price_field_value',
380 'entity' => 'PriceFieldValue',
381 'bao' => 'CRM_Price_BAO_PriceFieldValue',
384 'type' => 'CheckBox',
387 'is_active' => array(
388 'name' => 'is_active',
389 'type' => CRM_Utils_Type
::T_BOOLEAN
,
390 'title' => ts('Price Field Value is Active') ,
391 'description' => 'Is this price field value active',
393 'table_name' => 'civicrm_price_field_value',
394 'entity' => 'PriceFieldValue',
395 'bao' => 'CRM_Price_BAO_PriceFieldValue',
398 'financial_type_id' => array(
399 'name' => 'financial_type_id',
400 'type' => CRM_Utils_Type
::T_INT
,
401 'title' => ts('Financial Type') ,
402 'description' => 'FK to Financial Type.',
404 'table_name' => 'civicrm_price_field_value',
405 'entity' => 'PriceFieldValue',
406 'bao' => 'CRM_Price_BAO_PriceFieldValue',
408 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
412 'pseudoconstant' => array(
413 'table' => 'civicrm_financial_type',
415 'labelColumn' => 'name',
418 'non_deductible_amount' => array(
419 'name' => 'non_deductible_amount',
420 'type' => CRM_Utils_Type
::T_MONEY
,
421 'title' => ts('Non-deductible Amount') ,
422 'description' => 'Portion of total amount which is NOT tax deductible.',
424 'precision' => array(
429 'table_name' => 'civicrm_price_field_value',
430 'entity' => 'PriceFieldValue',
431 'bao' => 'CRM_Price_BAO_PriceFieldValue',
438 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
440 return Civi
::$statics[__CLASS__
]['fields'];
443 * Return a mapping from field-name to the corresponding key (as used in fields()).
446 * Array(string $name => string $uniqueName).
448 static function &fieldKeys() {
449 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
450 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
452 return Civi
::$statics[__CLASS__
]['fieldKeys'];
455 * Returns the names of this table
459 static function getTableName() {
460 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
463 * Returns if this table needs to be logged
471 * Returns the list of fields that can be imported
473 * @param bool $prefix
477 static function &import($prefix = false) {
478 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_field_value', $prefix, array());
482 * Returns the list of fields that can be exported
484 * @param bool $prefix
488 static function &export($prefix = false) {
489 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_field_value', $prefix, array());