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:f0ace0187969a76ff45c62032e8303a2)
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',
196 'price_field_id' => array(
197 'name' => 'price_field_id',
198 'type' => CRM_Utils_Type
::T_INT
,
199 'title' => ts('Price Field') ,
200 'description' => 'FK to civicrm_price_field',
202 'table_name' => 'civicrm_price_field_value',
203 'entity' => 'PriceFieldValue',
204 'bao' => 'CRM_Price_BAO_PriceFieldValue',
205 'FKClassName' => 'CRM_Price_DAO_PriceField',
209 'type' => CRM_Utils_Type
::T_STRING
,
210 'title' => ts('Name') ,
211 'description' => 'Price field option name',
213 'size' => CRM_Utils_Type
::HUGE
,
214 'table_name' => 'civicrm_price_field_value',
215 'entity' => 'PriceFieldValue',
216 'bao' => 'CRM_Price_BAO_PriceFieldValue',
223 'type' => CRM_Utils_Type
::T_STRING
,
224 'title' => ts('Label') ,
225 'description' => 'Price field option label',
227 'size' => CRM_Utils_Type
::HUGE
,
228 'table_name' => 'civicrm_price_field_value',
229 'entity' => 'PriceFieldValue',
230 'bao' => 'CRM_Price_BAO_PriceFieldValue',
235 'description' => array(
236 'name' => 'description',
237 'type' => CRM_Utils_Type
::T_TEXT
,
238 'title' => ts('Description') ,
239 'description' => '>Price field option description.',
243 'table_name' => 'civicrm_price_field_value',
244 'entity' => 'PriceFieldValue',
245 'bao' => 'CRM_Price_BAO_PriceFieldValue',
247 'type' => 'TextArea',
251 'name' => 'help_pre',
252 'type' => CRM_Utils_Type
::T_TEXT
,
253 'title' => ts('Help Pre') ,
254 'description' => 'Price field option pre help text.',
258 'table_name' => 'civicrm_price_field_value',
259 'entity' => 'PriceFieldValue',
260 'bao' => 'CRM_Price_BAO_PriceFieldValue',
262 'type' => 'TextArea',
265 'help_post' => array(
266 'name' => 'help_post',
267 'type' => CRM_Utils_Type
::T_TEXT
,
268 'title' => ts('Help Post') ,
269 'description' => 'Price field option post field help.',
273 'table_name' => 'civicrm_price_field_value',
274 'entity' => 'PriceFieldValue',
275 'bao' => 'CRM_Price_BAO_PriceFieldValue',
277 'type' => 'TextArea',
282 'type' => CRM_Utils_Type
::T_STRING
,
283 'title' => ts('Amount') ,
284 'description' => 'Price field option amount',
288 'table_name' => 'civicrm_price_field_value',
289 'entity' => 'PriceFieldValue',
290 'bao' => 'CRM_Price_BAO_PriceFieldValue',
297 'type' => CRM_Utils_Type
::T_INT
,
298 'title' => ts('Count') ,
299 'description' => 'Number of participants per field option',
301 'table_name' => 'civicrm_price_field_value',
302 'entity' => 'PriceFieldValue',
303 'bao' => 'CRM_Price_BAO_PriceFieldValue',
308 'max_value' => array(
309 'name' => 'max_value',
310 'type' => CRM_Utils_Type
::T_INT
,
311 'title' => ts('Max Value') ,
312 'description' => 'Max number of participants per field options',
314 'table_name' => 'civicrm_price_field_value',
315 'entity' => 'PriceFieldValue',
316 'bao' => 'CRM_Price_BAO_PriceFieldValue',
323 'type' => CRM_Utils_Type
::T_INT
,
324 'title' => ts('Order') ,
325 'description' => 'Order in which the field options should appear',
327 'table_name' => 'civicrm_price_field_value',
328 'entity' => 'PriceFieldValue',
329 'bao' => 'CRM_Price_BAO_PriceFieldValue',
334 'membership_type_id' => array(
335 'name' => 'membership_type_id',
336 'type' => CRM_Utils_Type
::T_INT
,
337 'title' => ts('Membership Type') ,
338 'description' => 'FK to Membership Type',
340 'table_name' => 'civicrm_price_field_value',
341 'entity' => 'PriceFieldValue',
342 'bao' => 'CRM_Price_BAO_PriceFieldValue',
343 'FKClassName' => 'CRM_Member_DAO_MembershipType',
348 'membership_num_terms' => array(
349 'name' => 'membership_num_terms',
350 'type' => CRM_Utils_Type
::T_INT
,
351 'title' => ts('Membership Num Terms') ,
352 'description' => 'Number of terms for this membership',
354 'table_name' => 'civicrm_price_field_value',
355 'entity' => 'PriceFieldValue',
356 'bao' => 'CRM_Price_BAO_PriceFieldValue',
361 'is_default' => array(
362 'name' => 'is_default',
363 'type' => CRM_Utils_Type
::T_BOOLEAN
,
364 'title' => ts('Is Default Price Field Option?') ,
365 'description' => 'Is this default price field option',
366 'table_name' => 'civicrm_price_field_value',
367 'entity' => 'PriceFieldValue',
368 'bao' => 'CRM_Price_BAO_PriceFieldValue',
370 'type' => 'CheckBox',
373 'is_active' => array(
374 'name' => 'is_active',
375 'type' => CRM_Utils_Type
::T_BOOLEAN
,
376 'title' => ts('Price Field Value is Active') ,
377 'description' => 'Is this price field value active',
379 'table_name' => 'civicrm_price_field_value',
380 'entity' => 'PriceFieldValue',
381 'bao' => 'CRM_Price_BAO_PriceFieldValue',
383 'financial_type_id' => array(
384 'name' => 'financial_type_id',
385 'type' => CRM_Utils_Type
::T_INT
,
386 'title' => ts('Financial Type') ,
387 'description' => 'FK to Financial Type.',
389 'table_name' => 'civicrm_price_field_value',
390 'entity' => 'PriceFieldValue',
391 'bao' => 'CRM_Price_BAO_PriceFieldValue',
392 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
396 'pseudoconstant' => array(
397 'table' => 'civicrm_financial_type',
399 'labelColumn' => 'name',
402 'non_deductible_amount' => array(
403 'name' => 'non_deductible_amount',
404 'type' => CRM_Utils_Type
::T_MONEY
,
405 'title' => ts('Non-deductible Amount') ,
406 'description' => 'Portion of total amount which is NOT tax deductible.',
408 'precision' => array(
413 'table_name' => 'civicrm_price_field_value',
414 'entity' => 'PriceFieldValue',
415 'bao' => 'CRM_Price_BAO_PriceFieldValue',
421 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
423 return Civi
::$statics[__CLASS__
]['fields'];
426 * Return a mapping from field-name to the corresponding key (as used in fields()).
429 * Array(string $name => string $uniqueName).
431 static function &fieldKeys() {
432 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
433 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
435 return Civi
::$statics[__CLASS__
]['fieldKeys'];
438 * Returns the names of this table
442 static function getTableName() {
443 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
446 * Returns if this table needs to be logged
454 * Returns the list of fields that can be imported
456 * @param bool $prefix
460 static function &import($prefix = false) {
461 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_field_value', $prefix, array());
465 * Returns the list of fields that can be exported
467 * @param bool $prefix
471 static function &export($prefix = false) {
472 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_field_value', $prefix, array());