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:80d53a8eb9ccb6a4fe13148a41fb30d1)
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',
171 'domain_id' => array(
172 'name' => 'domain_id',
173 'type' => CRM_Utils_Type
::T_INT
,
174 'title' => ts('Price Set Domain') ,
175 'description' => 'Which Domain is this price-set for',
176 'table_name' => 'civicrm_price_set',
177 'entity' => 'PriceSet',
178 'bao' => 'CRM_Price_BAO_PriceSet',
179 'FKClassName' => 'CRM_Core_DAO_Domain',
183 'pseudoconstant' => array(
184 'table' => 'civicrm_domain',
186 'labelColumn' => 'name',
191 'type' => CRM_Utils_Type
::T_STRING
,
192 'title' => ts('Name') ,
193 'description' => 'Variable name/programmatic handle for this set of price fields.',
196 'size' => CRM_Utils_Type
::HUGE
,
197 'table_name' => 'civicrm_price_set',
198 'entity' => 'PriceSet',
199 'bao' => 'CRM_Price_BAO_PriceSet',
206 'type' => CRM_Utils_Type
::T_STRING
,
207 'title' => ts('Price Set Title') ,
208 'description' => 'Displayed title for the Price Set.',
211 'size' => CRM_Utils_Type
::HUGE
,
212 'table_name' => 'civicrm_price_set',
213 'entity' => 'PriceSet',
214 'bao' => 'CRM_Price_BAO_PriceSet',
219 'is_active' => array(
220 'name' => 'is_active',
221 'type' => CRM_Utils_Type
::T_BOOLEAN
,
222 'title' => ts('Price Set Is Active?') ,
223 'description' => 'Is this price set active',
225 'table_name' => 'civicrm_price_set',
226 'entity' => 'PriceSet',
227 'bao' => 'CRM_Price_BAO_PriceSet',
229 'type' => 'CheckBox',
233 'name' => 'help_pre',
234 'type' => CRM_Utils_Type
::T_TEXT
,
235 'title' => ts('Price Set Pre Help') ,
236 'description' => 'Description and/or help text to display before fields in form.',
239 'table_name' => 'civicrm_price_set',
240 'entity' => 'PriceSet',
241 'bao' => 'CRM_Price_BAO_PriceSet',
243 'type' => 'TextArea',
246 'help_post' => array(
247 'name' => 'help_post',
248 'type' => CRM_Utils_Type
::T_TEXT
,
249 'title' => ts('Price Set Post Help') ,
250 'description' => 'Description and/or help text to display after fields in form.',
253 'table_name' => 'civicrm_price_set',
254 'entity' => 'PriceSet',
255 'bao' => 'CRM_Price_BAO_PriceSet',
257 'type' => 'TextArea',
260 'javascript' => array(
261 'name' => 'javascript',
262 'type' => CRM_Utils_Type
::T_STRING
,
263 'title' => ts('Price Set Javascript') ,
264 'description' => 'Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional',
266 'size' => CRM_Utils_Type
::BIG
,
267 'table_name' => 'civicrm_price_set',
268 'entity' => 'PriceSet',
269 'bao' => 'CRM_Price_BAO_PriceSet',
276 'type' => CRM_Utils_Type
::T_STRING
,
277 'title' => ts('Price Set Extends') ,
278 'description' => 'What components are using this price set?',
281 'size' => CRM_Utils_Type
::HUGE
,
282 'table_name' => 'civicrm_price_set',
283 'entity' => 'PriceSet',
284 'bao' => 'CRM_Price_BAO_PriceSet',
288 'pseudoconstant' => array(
289 'table' => 'civicrm_component',
291 'labelColumn' => 'name',
294 'financial_type_id' => array(
295 'name' => 'financial_type_id',
296 'type' => CRM_Utils_Type
::T_INT
,
297 'title' => ts('Financial Type') ,
298 'description' => 'FK to Financial Type(for membership price sets only).',
300 'table_name' => 'civicrm_price_set',
301 'entity' => 'PriceSet',
302 'bao' => 'CRM_Price_BAO_PriceSet',
303 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
307 'pseudoconstant' => array(
308 'table' => 'civicrm_financial_type',
310 'labelColumn' => 'name',
313 'is_quick_config' => array(
314 'name' => 'is_quick_config',
315 'type' => CRM_Utils_Type
::T_BOOLEAN
,
316 'title' => ts('Is Price Set Quick Config?') ,
317 'description' => 'Is set if edited on Contribution or Event Page rather than through Manage Price Sets',
318 'table_name' => 'civicrm_price_set',
319 'entity' => 'PriceSet',
320 'bao' => 'CRM_Price_BAO_PriceSet',
322 'type' => 'CheckBox',
325 'is_reserved' => array(
326 'name' => 'is_reserved',
327 'type' => CRM_Utils_Type
::T_BOOLEAN
,
328 'title' => ts('Price Set Is Reserved') ,
329 'description' => 'Is this a predefined system price set (i.e. it can not be deleted, edited)?',
330 'table_name' => 'civicrm_price_set',
331 'entity' => 'PriceSet',
332 'bao' => 'CRM_Price_BAO_PriceSet',
334 'type' => 'CheckBox',
337 'min_amount' => array(
338 'name' => 'min_amount',
339 'type' => CRM_Utils_Type
::T_INT
,
340 'title' => ts('Minimum Amount') ,
341 'description' => 'Minimum Amount required for this set.',
342 'table_name' => 'civicrm_price_set',
343 'entity' => 'PriceSet',
344 'bao' => 'CRM_Price_BAO_PriceSet',
350 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
352 return Civi
::$statics[__CLASS__
]['fields'];
355 * Return a mapping from field-name to the corresponding key (as used in fields()).
358 * Array(string $name => string $uniqueName).
360 static function &fieldKeys() {
361 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
362 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
364 return Civi
::$statics[__CLASS__
]['fieldKeys'];
367 * Returns the names of this table
371 static function getTableName() {
372 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
375 * Returns if this table needs to be logged
383 * Returns the list of fields that can be imported
385 * @param bool $prefix
389 static function &import($prefix = false) {
390 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_set', $prefix, array());
394 * Returns the list of fields that can be exported
396 * @param bool $prefix
400 static function &export($prefix = false) {
401 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_set', $prefix, array());