5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Price/PriceSet.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:53c1906856d1a16d2edba1caa6a4fafc)
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 localized title of this entity.
133 public static function getEntityTitle() {
134 return ts('Price Sets');
138 * Returns foreign keys and entity references.
141 * [CRM_Core_Reference_Interface]
143 public static function getReferenceColumns() {
144 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
145 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
146 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
147 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'financial_type_id', 'civicrm_financial_type', 'id');
148 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
150 return Civi
::$statics[__CLASS__
]['links'];
154 * Returns all the column names of this table
158 public static function &fields() {
159 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
160 Civi
::$statics[__CLASS__
]['fields'] = [
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('Price Set'),
165 'description' => ts('Price Set'),
167 'where' => 'civicrm_price_set.id',
168 'table_name' => 'civicrm_price_set',
169 'entity' => 'PriceSet',
170 'bao' => 'CRM_Price_BAO_PriceSet',
178 'name' => 'domain_id',
179 'type' => CRM_Utils_Type
::T_INT
,
180 'title' => ts('Price Set Domain'),
181 'description' => ts('Which Domain is this price-set for'),
182 'where' => 'civicrm_price_set.domain_id',
183 'table_name' => 'civicrm_price_set',
184 'entity' => 'PriceSet',
185 'bao' => 'CRM_Price_BAO_PriceSet',
187 'FKClassName' => 'CRM_Core_DAO_Domain',
191 'pseudoconstant' => [
192 'table' => 'civicrm_domain',
194 'labelColumn' => 'name',
200 'type' => CRM_Utils_Type
::T_STRING
,
201 'title' => ts('Name'),
202 'description' => ts('Variable name/programmatic handle for this set of price fields.'),
205 'size' => CRM_Utils_Type
::HUGE
,
206 'where' => 'civicrm_price_set.name',
207 'table_name' => 'civicrm_price_set',
208 'entity' => 'PriceSet',
209 'bao' => 'CRM_Price_BAO_PriceSet',
218 'type' => CRM_Utils_Type
::T_STRING
,
219 'title' => ts('Price Set Title'),
220 'description' => ts('Displayed title for the Price Set.'),
223 'size' => CRM_Utils_Type
::HUGE
,
224 'where' => 'civicrm_price_set.title',
225 'table_name' => 'civicrm_price_set',
226 'entity' => 'PriceSet',
227 'bao' => 'CRM_Price_BAO_PriceSet',
235 'name' => 'is_active',
236 'type' => CRM_Utils_Type
::T_BOOLEAN
,
237 'title' => ts('Price Set Is Active?'),
238 'description' => ts('Is this price set active'),
239 'where' => 'civicrm_price_set.is_active',
241 'table_name' => 'civicrm_price_set',
242 'entity' => 'PriceSet',
243 'bao' => 'CRM_Price_BAO_PriceSet',
246 'type' => 'CheckBox',
251 'name' => 'help_pre',
252 'type' => CRM_Utils_Type
::T_TEXT
,
253 'title' => ts('Price Set Pre Help'),
254 'description' => ts('Description and/or help text to display before fields in form.'),
257 'where' => 'civicrm_price_set.help_pre',
258 'table_name' => 'civicrm_price_set',
259 'entity' => 'PriceSet',
260 'bao' => 'CRM_Price_BAO_PriceSet',
263 'type' => 'TextArea',
268 'name' => 'help_post',
269 'type' => CRM_Utils_Type
::T_TEXT
,
270 'title' => ts('Price Set Post Help'),
271 'description' => ts('Description and/or help text to display after fields in form.'),
274 'where' => 'civicrm_price_set.help_post',
275 'table_name' => 'civicrm_price_set',
276 'entity' => 'PriceSet',
277 'bao' => 'CRM_Price_BAO_PriceSet',
280 'type' => 'TextArea',
285 'name' => 'javascript',
286 'type' => CRM_Utils_Type
::T_STRING
,
287 'title' => ts('Price Set Javascript'),
288 'description' => ts('Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional'),
290 'size' => CRM_Utils_Type
::BIG
,
291 'where' => 'civicrm_price_set.javascript',
292 'table_name' => 'civicrm_price_set',
293 'entity' => 'PriceSet',
294 'bao' => 'CRM_Price_BAO_PriceSet',
303 'type' => CRM_Utils_Type
::T_STRING
,
304 'title' => ts('Price Set Extends'),
305 'description' => ts('What components are using this price set?'),
308 'size' => CRM_Utils_Type
::HUGE
,
309 'where' => 'civicrm_price_set.extends',
310 'table_name' => 'civicrm_price_set',
311 'entity' => 'PriceSet',
312 'bao' => 'CRM_Price_BAO_PriceSet',
317 'pseudoconstant' => [
318 'table' => 'civicrm_component',
320 'labelColumn' => 'name',
324 'financial_type_id' => [
325 'name' => 'financial_type_id',
326 'type' => CRM_Utils_Type
::T_INT
,
327 'title' => ts('Financial Type'),
328 'description' => ts('FK to Financial Type(for membership price sets only).'),
329 'where' => 'civicrm_price_set.financial_type_id',
331 'table_name' => 'civicrm_price_set',
332 'entity' => 'PriceSet',
333 'bao' => 'CRM_Price_BAO_PriceSet',
335 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
339 'pseudoconstant' => [
340 'table' => 'civicrm_financial_type',
342 'labelColumn' => 'name',
346 'is_quick_config' => [
347 'name' => 'is_quick_config',
348 'type' => CRM_Utils_Type
::T_BOOLEAN
,
349 'title' => ts('Is Price Set Quick Config?'),
350 'description' => ts('Is set if edited on Contribution or Event Page rather than through Manage Price Sets'),
351 'where' => 'civicrm_price_set.is_quick_config',
353 'table_name' => 'civicrm_price_set',
354 'entity' => 'PriceSet',
355 'bao' => 'CRM_Price_BAO_PriceSet',
358 'type' => 'CheckBox',
363 'name' => 'is_reserved',
364 'type' => CRM_Utils_Type
::T_BOOLEAN
,
365 'title' => ts('Price Set Is Reserved'),
366 'description' => ts('Is this a predefined system price set (i.e. it can not be deleted, edited)?'),
367 'where' => 'civicrm_price_set.is_reserved',
369 'table_name' => 'civicrm_price_set',
370 'entity' => 'PriceSet',
371 'bao' => 'CRM_Price_BAO_PriceSet',
374 'type' => 'CheckBox',
379 'name' => 'min_amount',
380 'type' => CRM_Utils_Type
::T_INT
,
381 'title' => ts('Minimum Amount'),
382 'description' => ts('Minimum Amount required for this set.'),
383 'where' => 'civicrm_price_set.min_amount',
385 'table_name' => 'civicrm_price_set',
386 'entity' => 'PriceSet',
387 'bao' => 'CRM_Price_BAO_PriceSet',
395 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
397 return Civi
::$statics[__CLASS__
]['fields'];
401 * Return a mapping from field-name to the corresponding key (as used in fields()).
404 * Array(string $name => string $uniqueName).
406 public static function &fieldKeys() {
407 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
408 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
410 return Civi
::$statics[__CLASS__
]['fieldKeys'];
414 * Returns the names of this table
418 public static function getTableName() {
419 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
423 * Returns if this table needs to be logged
427 public function getLog() {
432 * Returns the list of fields that can be imported
434 * @param bool $prefix
438 public static function &import($prefix = FALSE) {
439 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_set', $prefix, []);
444 * Returns the list of fields that can be exported
446 * @param bool $prefix
450 public static function &export($prefix = FALSE) {
451 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_set', $prefix, []);
456 * Returns the list of indices
458 * @param bool $localize
462 public static function indices($localize = TRUE) {
469 'localizable' => FALSE,
471 'sig' => 'civicrm_price_set::1::name',
474 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;