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/PriceSet.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:0b3a382a33511312a5f3b909f214345d)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Price_DAO_PriceSet constructor.
40 class CRM_Price_DAO_PriceSet
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_price_set';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Which Domain is this price-set for
66 * Variable name/programmatic handle for this set of price fields.
72 * Displayed title for the Price Set.
78 * Is this price set active
84 * Description and/or help text to display before fields in form.
90 * Description and/or help text to display after fields in form.
96 * Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional
102 * What components are using this price set?
108 * FK to Financial Type(for membership price sets only).
112 public $financial_type_id;
114 * Is set if edited on Contribution or Event Page rather than through Manage Price Sets
118 public $is_quick_config;
120 * Is this a predefined system price set (i.e. it can not be deleted, edited)?
126 * Minimum Amount required for this set.
134 function __construct() {
135 $this->__table
= 'civicrm_price_set';
136 parent
::__construct();
139 * Returns foreign keys and entity references.
142 * [CRM_Core_Reference_Interface]
144 static function getReferenceColumns() {
145 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
146 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
147 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'domain_id', 'civicrm_domain', 'id');
148 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id');
149 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
151 return Civi
::$statics[__CLASS__
]['links'];
154 * Returns all the column names of this table
158 static function &fields() {
159 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
160 Civi
::$statics[__CLASS__
]['fields'] = array(
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('Price Set ID') ,
165 'description' => 'Price Set',
167 'table_name' => 'civicrm_price_set',
168 'entity' => 'PriceSet',
169 'bao' => 'CRM_Price_BAO_PriceSet',
172 'domain_id' => array(
173 'name' => 'domain_id',
174 'type' => CRM_Utils_Type
::T_INT
,
175 'title' => ts('Price Set Domain') ,
176 'description' => 'Which Domain is this price-set for',
177 'table_name' => 'civicrm_price_set',
178 'entity' => 'PriceSet',
179 'bao' => 'CRM_Price_BAO_PriceSet',
181 'FKClassName' => 'CRM_Core_DAO_Domain',
185 'pseudoconstant' => array(
186 'table' => 'civicrm_domain',
188 'labelColumn' => 'name',
193 'type' => CRM_Utils_Type
::T_STRING
,
194 'title' => ts('Name') ,
195 'description' => 'Variable name/programmatic handle for this set of price fields.',
198 'size' => CRM_Utils_Type
::HUGE
,
199 'table_name' => 'civicrm_price_set',
200 'entity' => 'PriceSet',
201 'bao' => 'CRM_Price_BAO_PriceSet',
209 'type' => CRM_Utils_Type
::T_STRING
,
210 'title' => ts('Price Set Title') ,
211 'description' => 'Displayed title for the Price Set.',
214 'size' => CRM_Utils_Type
::HUGE
,
215 'table_name' => 'civicrm_price_set',
216 'entity' => 'PriceSet',
217 'bao' => 'CRM_Price_BAO_PriceSet',
223 'is_active' => array(
224 'name' => 'is_active',
225 'type' => CRM_Utils_Type
::T_BOOLEAN
,
226 'title' => ts('Price Set Is Active?') ,
227 'description' => 'Is this price set active',
229 'table_name' => 'civicrm_price_set',
230 'entity' => 'PriceSet',
231 'bao' => 'CRM_Price_BAO_PriceSet',
234 'type' => 'CheckBox',
238 'name' => 'help_pre',
239 'type' => CRM_Utils_Type
::T_TEXT
,
240 'title' => ts('Price Set Pre Help') ,
241 'description' => 'Description and/or help text to display before fields in form.',
244 'table_name' => 'civicrm_price_set',
245 'entity' => 'PriceSet',
246 'bao' => 'CRM_Price_BAO_PriceSet',
249 'type' => 'TextArea',
252 'help_post' => array(
253 'name' => 'help_post',
254 'type' => CRM_Utils_Type
::T_TEXT
,
255 'title' => ts('Price Set Post Help') ,
256 'description' => 'Description and/or help text to display after fields in form.',
259 'table_name' => 'civicrm_price_set',
260 'entity' => 'PriceSet',
261 'bao' => 'CRM_Price_BAO_PriceSet',
264 'type' => 'TextArea',
267 'javascript' => array(
268 'name' => 'javascript',
269 'type' => CRM_Utils_Type
::T_STRING
,
270 'title' => ts('Price Set Javascript') ,
271 'description' => 'Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional',
273 'size' => CRM_Utils_Type
::BIG
,
274 'table_name' => 'civicrm_price_set',
275 'entity' => 'PriceSet',
276 'bao' => 'CRM_Price_BAO_PriceSet',
284 'type' => CRM_Utils_Type
::T_STRING
,
285 'title' => ts('Price Set Extends') ,
286 'description' => 'What components are using this price set?',
289 'size' => CRM_Utils_Type
::HUGE
,
290 'table_name' => 'civicrm_price_set',
291 'entity' => 'PriceSet',
292 'bao' => 'CRM_Price_BAO_PriceSet',
297 'pseudoconstant' => array(
298 'table' => 'civicrm_component',
300 'labelColumn' => 'name',
303 'financial_type_id' => array(
304 'name' => 'financial_type_id',
305 'type' => CRM_Utils_Type
::T_INT
,
306 'title' => ts('Financial Type') ,
307 'description' => 'FK to Financial Type(for membership price sets only).',
309 'table_name' => 'civicrm_price_set',
310 'entity' => 'PriceSet',
311 'bao' => 'CRM_Price_BAO_PriceSet',
313 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
317 'pseudoconstant' => array(
318 'table' => 'civicrm_financial_type',
320 'labelColumn' => 'name',
323 'is_quick_config' => array(
324 'name' => 'is_quick_config',
325 'type' => CRM_Utils_Type
::T_BOOLEAN
,
326 'title' => ts('Is Price Set Quick Config?') ,
327 'description' => 'Is set if edited on Contribution or Event Page rather than through Manage Price Sets',
328 'table_name' => 'civicrm_price_set',
329 'entity' => 'PriceSet',
330 'bao' => 'CRM_Price_BAO_PriceSet',
333 'type' => 'CheckBox',
336 'is_reserved' => array(
337 'name' => 'is_reserved',
338 'type' => CRM_Utils_Type
::T_BOOLEAN
,
339 'title' => ts('Price Set Is Reserved') ,
340 'description' => 'Is this a predefined system price set (i.e. it can not be deleted, edited)?',
341 'table_name' => 'civicrm_price_set',
342 'entity' => 'PriceSet',
343 'bao' => 'CRM_Price_BAO_PriceSet',
346 'type' => 'CheckBox',
349 'min_amount' => array(
350 'name' => 'min_amount',
351 'type' => CRM_Utils_Type
::T_INT
,
352 'title' => ts('Minimum Amount') ,
353 'description' => 'Minimum Amount required for this set.',
354 'table_name' => 'civicrm_price_set',
355 'entity' => 'PriceSet',
356 'bao' => 'CRM_Price_BAO_PriceSet',
363 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
365 return Civi
::$statics[__CLASS__
]['fields'];
368 * Return a mapping from field-name to the corresponding key (as used in fields()).
371 * Array(string $name => string $uniqueName).
373 static function &fieldKeys() {
374 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
375 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
377 return Civi
::$statics[__CLASS__
]['fieldKeys'];
380 * Returns the names of this table
384 static function getTableName() {
385 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
388 * Returns if this table needs to be logged
396 * Returns the list of fields that can be imported
398 * @param bool $prefix
402 static function &import($prefix = false) {
403 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_set', $prefix, array());
407 * Returns the list of fields that can be exported
409 * @param bool $prefix
413 static function &export($prefix = false) {
414 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_set', $prefix, array());