3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Price/PriceFieldValue.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:ed52bc054bb8aed4bb154756a79fafa1)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Price_DAO_PriceFieldValue
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_price_field_value';
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
58 * FK to civicrm_price_field
62 public $price_field_id;
64 * Price field option name
70 * Price field option label
76 * >Price field option description.
82 * Price field option pre help text.
88 * Price field option post field help.
94 * Price field option amount
100 * Number of participants per field option
106 * Max number of participants per field options
112 * Order in which the field options should appear
118 * FK to Membership Type
122 public $membership_type_id;
124 * Number of terms for this membership
128 public $membership_num_terms;
130 * Is this default price field option
136 * Is this price field value active
142 * FK to Financial Type.
146 public $financial_type_id;
148 * Portion of total amount which is NOT tax deductible.
152 public $non_deductible_amount;
156 * @return civicrm_price_field_value
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',
193 'price_field_id' => array(
194 'name' => 'price_field_id',
195 'type' => CRM_Utils_Type
::T_INT
,
196 'title' => ts('Price Field') ,
197 'description' => 'FK to civicrm_price_field',
199 'FKClassName' => 'CRM_Price_DAO_PriceField',
203 'type' => CRM_Utils_Type
::T_STRING
,
204 'title' => ts('Name') ,
205 'description' => 'Price field option name',
207 'size' => CRM_Utils_Type
::HUGE
,
214 'type' => CRM_Utils_Type
::T_STRING
,
215 'title' => ts('Label') ,
216 'description' => 'Price field option label',
218 'size' => CRM_Utils_Type
::HUGE
,
223 'description' => array(
224 'name' => 'description',
225 'type' => CRM_Utils_Type
::T_TEXT
,
226 'title' => ts('Description') ,
227 'description' => '>Price field option description.',
232 'type' => 'TextArea',
236 'name' => 'help_pre',
237 'type' => CRM_Utils_Type
::T_TEXT
,
238 'title' => ts('Help Pre') ,
239 'description' => 'Price field option pre help text.',
244 'type' => 'TextArea',
247 'help_post' => array(
248 'name' => 'help_post',
249 'type' => CRM_Utils_Type
::T_TEXT
,
250 'title' => ts('Help Post') ,
251 'description' => 'Price field option post field help.',
256 'type' => 'TextArea',
261 'type' => CRM_Utils_Type
::T_STRING
,
262 'title' => ts('Amount') ,
263 'description' => 'Price field option amount',
273 'type' => CRM_Utils_Type
::T_INT
,
274 'title' => ts('Count') ,
275 'description' => 'Number of participants per field option',
281 'max_value' => array(
282 'name' => 'max_value',
283 'type' => CRM_Utils_Type
::T_INT
,
284 'title' => ts('Max Value') ,
285 'description' => 'Max number of participants per field options',
293 'type' => CRM_Utils_Type
::T_INT
,
294 'title' => ts('Order') ,
295 'description' => 'Order in which the field options should appear',
301 'membership_type_id' => array(
302 'name' => 'membership_type_id',
303 'type' => CRM_Utils_Type
::T_INT
,
304 'title' => ts('Membership Type') ,
305 'description' => 'FK to Membership Type',
307 'FKClassName' => 'CRM_Member_DAO_MembershipType',
312 'membership_num_terms' => array(
313 'name' => 'membership_num_terms',
314 'type' => CRM_Utils_Type
::T_INT
,
315 'title' => ts('Membership Num Terms') ,
316 'description' => 'Number of terms for this membership',
322 'is_default' => array(
323 'name' => 'is_default',
324 'type' => CRM_Utils_Type
::T_BOOLEAN
,
325 'title' => ts('Is Default Price Field Option?') ,
326 'description' => 'Is this default price field option',
328 'type' => 'CheckBox',
331 'is_active' => array(
332 'name' => 'is_active',
333 'type' => CRM_Utils_Type
::T_BOOLEAN
,
334 'title' => ts('Price Field Value is Active') ,
335 'description' => 'Is this price field value active',
338 'financial_type_id' => array(
339 'name' => 'financial_type_id',
340 'type' => CRM_Utils_Type
::T_INT
,
341 'title' => ts('Financial Type') ,
342 'description' => 'FK to Financial Type.',
344 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
348 'pseudoconstant' => array(
349 'table' => 'civicrm_financial_type',
351 'labelColumn' => 'name',
354 'non_deductible_amount' => array(
355 'name' => 'non_deductible_amount',
356 'type' => CRM_Utils_Type
::T_MONEY
,
357 'title' => ts('Non-deductible Amount') ,
358 'description' => 'Portion of total amount which is NOT tax deductible.',
360 'precision' => array(
370 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
372 return Civi
::$statics[__CLASS__
]['fields'];
375 * Return a mapping from field-name to the corresponding key (as used in fields()).
378 * Array(string $name => string $uniqueName).
380 static function &fieldKeys() {
381 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
382 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
384 return Civi
::$statics[__CLASS__
]['fieldKeys'];
387 * Returns the names of this table
391 static function getTableName() {
392 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
395 * Returns if this table needs to be logged
403 * Returns the list of fields that can be imported
405 * @param bool $prefix
409 static function &import($prefix = false) {
410 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_field_value', $prefix, array());
414 * Returns the list of fields that can be exported
416 * @param bool $prefix
420 static function &export($prefix = false) {
421 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_field_value', $prefix, array());