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:1642f2b38411573c40848c0d7c83c74c)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Price_DAO_PriceSet
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_price_set';
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
58 * Which Domain is this price-set for
64 * Variable name/programmatic handle for this set of price fields.
70 * Displayed title for the Price Set.
76 * Is this price set active
82 * Description and/or help text to display before fields in form.
88 * Description and/or help text to display after fields in form.
94 * Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional
100 * What components are using this price set?
106 * FK to Financial Type(for membership price sets only).
110 public $financial_type_id;
112 * Is set if edited on Contribution or Event Page rather than through Manage Price Sets
116 public $is_quick_config;
118 * Is this a predefined system price set (i.e. it can not be deleted, edited)?
124 * Minimum Amount required for this set.
132 * @return civicrm_price_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',
168 'domain_id' => array(
169 'name' => 'domain_id',
170 'type' => CRM_Utils_Type
::T_INT
,
171 'title' => ts('Price Set Domain') ,
172 'description' => 'Which Domain is this price-set for',
173 'FKClassName' => 'CRM_Core_DAO_Domain',
177 'pseudoconstant' => array(
178 'table' => 'civicrm_domain',
180 'labelColumn' => 'name',
185 'type' => CRM_Utils_Type
::T_STRING
,
186 'title' => ts('Name') ,
187 'description' => 'Variable name/programmatic handle for this set of price fields.',
190 'size' => CRM_Utils_Type
::HUGE
,
197 'type' => CRM_Utils_Type
::T_STRING
,
198 'title' => ts('Price Set Title') ,
199 'description' => 'Displayed title for the Price Set.',
202 'size' => CRM_Utils_Type
::HUGE
,
207 'is_active' => array(
208 'name' => 'is_active',
209 'type' => CRM_Utils_Type
::T_BOOLEAN
,
210 'title' => ts('Price Set Is Active?') ,
211 'description' => 'Is this price set active',
214 'type' => 'CheckBox',
218 'name' => 'help_pre',
219 'type' => CRM_Utils_Type
::T_TEXT
,
220 'title' => ts('Price Set Pre Help') ,
221 'description' => 'Description and/or help text to display before fields in form.',
225 'type' => 'TextArea',
228 'help_post' => array(
229 'name' => 'help_post',
230 'type' => CRM_Utils_Type
::T_TEXT
,
231 'title' => ts('Price Set Post Help') ,
232 'description' => 'Description and/or help text to display after fields in form.',
236 'type' => 'TextArea',
239 'javascript' => array(
240 'name' => 'javascript',
241 'type' => CRM_Utils_Type
::T_STRING
,
242 'title' => ts('Price Set Javascript') ,
243 'description' => 'Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional',
245 'size' => CRM_Utils_Type
::BIG
,
252 'type' => CRM_Utils_Type
::T_STRING
,
253 'title' => ts('Price Set Extends') ,
254 'description' => 'What components are using this price set?',
257 'size' => CRM_Utils_Type
::HUGE
,
261 'pseudoconstant' => array(
262 'table' => 'civicrm_component',
264 'labelColumn' => 'name',
267 'financial_type_id' => array(
268 'name' => 'financial_type_id',
269 'type' => CRM_Utils_Type
::T_INT
,
270 'title' => ts('Financial Type') ,
271 'description' => 'FK to Financial Type(for membership price sets only).',
273 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
277 'pseudoconstant' => array(
278 'table' => 'civicrm_financial_type',
280 'labelColumn' => 'name',
283 'is_quick_config' => array(
284 'name' => 'is_quick_config',
285 'type' => CRM_Utils_Type
::T_BOOLEAN
,
286 'title' => ts('Is Price Set Quick Config?') ,
287 'description' => 'Is set if edited on Contribution or Event Page rather than through Manage Price Sets',
289 'type' => 'CheckBox',
292 'is_reserved' => array(
293 'name' => 'is_reserved',
294 'type' => CRM_Utils_Type
::T_BOOLEAN
,
295 'title' => ts('Price Set Is Reserved') ,
296 'description' => 'Is this a predefined system price set (i.e. it can not be deleted, edited)?',
298 'type' => 'CheckBox',
301 'min_amount' => array(
302 'name' => 'min_amount',
303 'type' => CRM_Utils_Type
::T_INT
,
304 'title' => ts('Minimum Amount') ,
305 'description' => 'Minimum Amount required for this set.',
311 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
313 return Civi
::$statics[__CLASS__
]['fields'];
316 * Return a mapping from field-name to the corresponding key (as used in fields()).
319 * Array(string $name => string $uniqueName).
321 static function &fieldKeys() {
322 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
323 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
325 return Civi
::$statics[__CLASS__
]['fieldKeys'];
328 * Returns the names of this table
332 static function getTableName() {
333 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
336 * Returns if this table needs to be logged
344 * Returns the list of fields that can be imported
346 * @param bool $prefix
350 static function &import($prefix = false) {
351 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_set', $prefix, array());
355 * Returns the list of fields that can be exported
357 * @param bool $prefix
361 static function &export($prefix = false) {
362 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_set', $prefix, array());