5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Price/PriceSet.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:2465848603f66c170842a63e347ab3e7)
13 * Database access object for the PriceSet entity.
15 class CRM_Price_DAO_PriceSet
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_price_set';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
39 * Which Domain is this price-set for
46 * Variable name/programmatic handle for this set of price fields.
53 * Displayed title for the Price Set.
60 * Is this price set active
67 * Description and/or help text to display before fields in form.
74 * Description and/or help text to display after fields in form.
81 * Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional
88 * What components are using this price set?
95 * FK to Financial Type(for membership price sets only).
99 public $financial_type_id;
102 * Is set if edited on Contribution or Event Page rather than through Manage Price Sets
106 public $is_quick_config;
109 * Is this a predefined system price set (i.e. it can not be deleted, edited)?
116 * Minimum Amount required for this set.
125 public function __construct() {
126 $this->__table
= 'civicrm_price_set';
127 parent
::__construct();
131 * Returns foreign keys and entity references.
134 * [CRM_Core_Reference_Interface]
136 public static function getReferenceColumns() {
137 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
138 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
139 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
140 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'financial_type_id', 'civicrm_financial_type', 'id');
141 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
143 return Civi
::$statics[__CLASS__
]['links'];
147 * Returns all the column names of this table
151 public static function &fields() {
152 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
153 Civi
::$statics[__CLASS__
]['fields'] = [
156 'type' => CRM_Utils_Type
::T_INT
,
157 'title' => ts('Price Set'),
158 'description' => ts('Price Set'),
160 'where' => 'civicrm_price_set.id',
161 'table_name' => 'civicrm_price_set',
162 'entity' => 'PriceSet',
163 'bao' => 'CRM_Price_BAO_PriceSet',
170 'name' => 'domain_id',
171 'type' => CRM_Utils_Type
::T_INT
,
172 'title' => ts('Price Set Domain'),
173 'description' => ts('Which Domain is this price-set for'),
174 'where' => 'civicrm_price_set.domain_id',
175 'table_name' => 'civicrm_price_set',
176 'entity' => 'PriceSet',
177 'bao' => 'CRM_Price_BAO_PriceSet',
179 'FKClassName' => 'CRM_Core_DAO_Domain',
183 'pseudoconstant' => [
184 'table' => 'civicrm_domain',
186 'labelColumn' => 'name',
191 'type' => CRM_Utils_Type
::T_STRING
,
192 'title' => ts('Name'),
193 'description' => ts('Variable name/programmatic handle for this set of price fields.'),
196 'size' => CRM_Utils_Type
::HUGE
,
197 'where' => 'civicrm_price_set.name',
198 'table_name' => 'civicrm_price_set',
199 'entity' => 'PriceSet',
200 'bao' => 'CRM_Price_BAO_PriceSet',
208 'type' => CRM_Utils_Type
::T_STRING
,
209 'title' => ts('Price Set Title'),
210 'description' => ts('Displayed title for the Price Set.'),
213 'size' => CRM_Utils_Type
::HUGE
,
214 'where' => 'civicrm_price_set.title',
215 'table_name' => 'civicrm_price_set',
216 'entity' => 'PriceSet',
217 'bao' => 'CRM_Price_BAO_PriceSet',
224 'name' => 'is_active',
225 'type' => CRM_Utils_Type
::T_BOOLEAN
,
226 'title' => ts('Price Set Is Active?'),
227 'description' => ts('Is this price set active'),
228 'where' => 'civicrm_price_set.is_active',
230 'table_name' => 'civicrm_price_set',
231 'entity' => 'PriceSet',
232 'bao' => 'CRM_Price_BAO_PriceSet',
235 'type' => 'CheckBox',
239 'name' => 'help_pre',
240 'type' => CRM_Utils_Type
::T_TEXT
,
241 'title' => ts('Price Set Pre Help'),
242 'description' => ts('Description and/or help text to display before fields in form.'),
245 'where' => 'civicrm_price_set.help_pre',
246 'table_name' => 'civicrm_price_set',
247 'entity' => 'PriceSet',
248 'bao' => 'CRM_Price_BAO_PriceSet',
251 'type' => 'TextArea',
255 'name' => 'help_post',
256 'type' => CRM_Utils_Type
::T_TEXT
,
257 'title' => ts('Price Set Post Help'),
258 'description' => ts('Description and/or help text to display after fields in form.'),
261 'where' => 'civicrm_price_set.help_post',
262 'table_name' => 'civicrm_price_set',
263 'entity' => 'PriceSet',
264 'bao' => 'CRM_Price_BAO_PriceSet',
267 'type' => 'TextArea',
271 'name' => 'javascript',
272 'type' => CRM_Utils_Type
::T_STRING
,
273 'title' => ts('Price Set Javascript'),
274 'description' => ts('Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional'),
276 'size' => CRM_Utils_Type
::BIG
,
277 'where' => 'civicrm_price_set.javascript',
278 'table_name' => 'civicrm_price_set',
279 'entity' => 'PriceSet',
280 'bao' => 'CRM_Price_BAO_PriceSet',
288 'type' => CRM_Utils_Type
::T_STRING
,
289 'title' => ts('Price Set Extends'),
290 'description' => ts('What components are using this price set?'),
293 'size' => CRM_Utils_Type
::HUGE
,
294 'where' => 'civicrm_price_set.extends',
295 'table_name' => 'civicrm_price_set',
296 'entity' => 'PriceSet',
297 'bao' => 'CRM_Price_BAO_PriceSet',
302 'pseudoconstant' => [
303 'table' => 'civicrm_component',
305 'labelColumn' => 'name',
308 'financial_type_id' => [
309 'name' => 'financial_type_id',
310 'type' => CRM_Utils_Type
::T_INT
,
311 'title' => ts('Financial Type'),
312 'description' => ts('FK to Financial Type(for membership price sets only).'),
313 'where' => 'civicrm_price_set.financial_type_id',
315 'table_name' => 'civicrm_price_set',
316 'entity' => 'PriceSet',
317 'bao' => 'CRM_Price_BAO_PriceSet',
319 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
323 'pseudoconstant' => [
324 'table' => 'civicrm_financial_type',
326 'labelColumn' => 'name',
329 'is_quick_config' => [
330 'name' => 'is_quick_config',
331 'type' => CRM_Utils_Type
::T_BOOLEAN
,
332 'title' => ts('Is Price Set Quick Config?'),
333 'description' => ts('Is set if edited on Contribution or Event Page rather than through Manage Price Sets'),
334 'where' => 'civicrm_price_set.is_quick_config',
336 'table_name' => 'civicrm_price_set',
337 'entity' => 'PriceSet',
338 'bao' => 'CRM_Price_BAO_PriceSet',
341 'type' => 'CheckBox',
345 'name' => 'is_reserved',
346 'type' => CRM_Utils_Type
::T_BOOLEAN
,
347 'title' => ts('Price Set Is Reserved'),
348 'description' => ts('Is this a predefined system price set (i.e. it can not be deleted, edited)?'),
349 'where' => 'civicrm_price_set.is_reserved',
351 'table_name' => 'civicrm_price_set',
352 'entity' => 'PriceSet',
353 'bao' => 'CRM_Price_BAO_PriceSet',
356 'type' => 'CheckBox',
360 'name' => 'min_amount',
361 'type' => CRM_Utils_Type
::T_INT
,
362 'title' => ts('Minimum Amount'),
363 'description' => ts('Minimum Amount required for this set.'),
364 'where' => 'civicrm_price_set.min_amount',
366 'table_name' => 'civicrm_price_set',
367 'entity' => 'PriceSet',
368 'bao' => 'CRM_Price_BAO_PriceSet',
375 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
377 return Civi
::$statics[__CLASS__
]['fields'];
381 * Return a mapping from field-name to the corresponding key (as used in fields()).
384 * Array(string $name => string $uniqueName).
386 public static function &fieldKeys() {
387 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
388 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
390 return Civi
::$statics[__CLASS__
]['fieldKeys'];
394 * Returns the names of this table
398 public static function getTableName() {
399 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
403 * Returns if this table needs to be logged
407 public function getLog() {
412 * Returns the list of fields that can be imported
414 * @param bool $prefix
418 public static function &import($prefix = FALSE) {
419 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_set', $prefix, []);
424 * Returns the list of fields that can be exported
426 * @param bool $prefix
430 public static function &export($prefix = FALSE) {
431 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_set', $prefix, []);
436 * Returns the list of indices
438 * @param bool $localize
442 public static function indices($localize = TRUE) {
449 'localizable' => FALSE,
451 'sig' => 'civicrm_price_set::1::name',
454 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;