Fix comments on DAO files
[civicrm-core.git] / CRM / Price / DAO / PriceSet.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2017
30 *
31 * Generated from xml/schema/CRM/Price/PriceSet.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:1642f2b38411573c40848c0d7c83c74c)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Price_DAO_PriceSet constructor.
39 */
40 class CRM_Price_DAO_PriceSet extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_price_set';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
49 *
50 * @var boolean
51 */
52 static $_log = true;
53 /**
54 * Price Set
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * Which Domain is this price-set for
61 *
62 * @var int unsigned
63 */
64 public $domain_id;
65 /**
66 * Variable name/programmatic handle for this set of price fields.
67 *
68 * @var string
69 */
70 public $name;
71 /**
72 * Displayed title for the Price Set.
73 *
74 * @var string
75 */
76 public $title;
77 /**
78 * Is this price set active
79 *
80 * @var boolean
81 */
82 public $is_active;
83 /**
84 * Description and/or help text to display before fields in form.
85 *
86 * @var text
87 */
88 public $help_pre;
89 /**
90 * Description and/or help text to display after fields in form.
91 *
92 * @var text
93 */
94 public $help_post;
95 /**
96 * Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional
97 *
98 * @var string
99 */
100 public $javascript;
101 /**
102 * What components are using this price set?
103 *
104 * @var string
105 */
106 public $extends;
107 /**
108 * FK to Financial Type(for membership price sets only).
109 *
110 * @var int unsigned
111 */
112 public $financial_type_id;
113 /**
114 * Is set if edited on Contribution or Event Page rather than through Manage Price Sets
115 *
116 * @var boolean
117 */
118 public $is_quick_config;
119 /**
120 * Is this a predefined system price set (i.e. it can not be deleted, edited)?
121 *
122 * @var boolean
123 */
124 public $is_reserved;
125 /**
126 * Minimum Amount required for this set.
127 *
128 * @var int unsigned
129 */
130 public $min_amount;
131 /**
132 * Class constructor.
133 */
134 function __construct() {
135 $this->__table = 'civicrm_price_set';
136 parent::__construct();
137 }
138 /**
139 * Returns foreign keys and entity references.
140 *
141 * @return array
142 * [CRM_Core_Reference_Interface]
143 */
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']);
150 }
151 return Civi::$statics[__CLASS__]['links'];
152 }
153 /**
154 * Returns all the column names of this table
155 *
156 * @return array
157 */
158 static function &fields() {
159 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
160 Civi::$statics[__CLASS__]['fields'] = array(
161 'id' => array(
162 'name' => 'id',
163 'type' => CRM_Utils_Type::T_INT,
164 'title' => ts('Price Set ID') ,
165 'description' => 'Price Set',
166 'required' => true,
167 ) ,
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',
174 'html' => array(
175 'type' => 'Text',
176 ) ,
177 'pseudoconstant' => array(
178 'table' => 'civicrm_domain',
179 'keyColumn' => 'id',
180 'labelColumn' => 'name',
181 )
182 ) ,
183 'name' => array(
184 'name' => 'name',
185 'type' => CRM_Utils_Type::T_STRING,
186 'title' => ts('Name') ,
187 'description' => 'Variable name/programmatic handle for this set of price fields.',
188 'required' => true,
189 'maxlength' => 255,
190 'size' => CRM_Utils_Type::HUGE,
191 'html' => array(
192 'type' => 'Text',
193 ) ,
194 ) ,
195 'title' => array(
196 'name' => 'title',
197 'type' => CRM_Utils_Type::T_STRING,
198 'title' => ts('Price Set Title') ,
199 'description' => 'Displayed title for the Price Set.',
200 'required' => true,
201 'maxlength' => 255,
202 'size' => CRM_Utils_Type::HUGE,
203 'html' => array(
204 'type' => 'Text',
205 ) ,
206 ) ,
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',
212 'default' => '1',
213 'html' => array(
214 'type' => 'CheckBox',
215 ) ,
216 ) ,
217 'help_pre' => array(
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.',
222 'rows' => 4,
223 'cols' => 80,
224 'html' => array(
225 'type' => 'TextArea',
226 ) ,
227 ) ,
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.',
233 'rows' => 4,
234 'cols' => 80,
235 'html' => array(
236 'type' => 'TextArea',
237 ) ,
238 ) ,
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',
244 'maxlength' => 64,
245 'size' => CRM_Utils_Type::BIG,
246 'html' => array(
247 'type' => 'Text',
248 ) ,
249 ) ,
250 'extends' => array(
251 'name' => 'extends',
252 'type' => CRM_Utils_Type::T_STRING,
253 'title' => ts('Price Set Extends') ,
254 'description' => 'What components are using this price set?',
255 'required' => true,
256 'maxlength' => 255,
257 'size' => CRM_Utils_Type::HUGE,
258 'html' => array(
259 'type' => 'Text',
260 ) ,
261 'pseudoconstant' => array(
262 'table' => 'civicrm_component',
263 'keyColumn' => 'id',
264 'labelColumn' => 'name',
265 )
266 ) ,
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).',
272 'default' => 'NULL',
273 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
274 'html' => array(
275 'type' => 'Select',
276 ) ,
277 'pseudoconstant' => array(
278 'table' => 'civicrm_financial_type',
279 'keyColumn' => 'id',
280 'labelColumn' => 'name',
281 )
282 ) ,
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',
288 'html' => array(
289 'type' => 'CheckBox',
290 ) ,
291 ) ,
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)?',
297 'html' => array(
298 'type' => 'CheckBox',
299 ) ,
300 ) ,
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.',
306 'html' => array(
307 'type' => 'Text',
308 ) ,
309 ) ,
310 );
311 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
312 }
313 return Civi::$statics[__CLASS__]['fields'];
314 }
315 /**
316 * Return a mapping from field-name to the corresponding key (as used in fields()).
317 *
318 * @return array
319 * Array(string $name => string $uniqueName).
320 */
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()));
324 }
325 return Civi::$statics[__CLASS__]['fieldKeys'];
326 }
327 /**
328 * Returns the names of this table
329 *
330 * @return string
331 */
332 static function getTableName() {
333 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
334 }
335 /**
336 * Returns if this table needs to be logged
337 *
338 * @return boolean
339 */
340 function getLog() {
341 return self::$_log;
342 }
343 /**
344 * Returns the list of fields that can be imported
345 *
346 * @param bool $prefix
347 *
348 * @return array
349 */
350 static function &import($prefix = false) {
351 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'price_set', $prefix, array());
352 return $r;
353 }
354 /**
355 * Returns the list of fields that can be exported
356 *
357 * @param bool $prefix
358 *
359 * @return array
360 */
361 static function &export($prefix = false) {
362 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'price_set', $prefix, array());
363 return $r;
364 }
365 }