5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Price/PriceSet.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:7250a5af1e713fc047875f2cc22443ff)
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 static $_tableName = 'civicrm_price_set';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 ID'),
158 'description' => 'Price Set',
160 'table_name' => 'civicrm_price_set',
161 'entity' => 'PriceSet',
162 'bao' => 'CRM_Price_BAO_PriceSet',
166 'name' => 'domain_id',
167 'type' => CRM_Utils_Type
::T_INT
,
168 'title' => ts('Price Set Domain'),
169 'description' => 'Which Domain is this price-set for',
170 'table_name' => 'civicrm_price_set',
171 'entity' => 'PriceSet',
172 'bao' => 'CRM_Price_BAO_PriceSet',
174 'FKClassName' => 'CRM_Core_DAO_Domain',
178 'pseudoconstant' => [
179 'table' => 'civicrm_domain',
181 'labelColumn' => 'name',
186 'type' => CRM_Utils_Type
::T_STRING
,
187 'title' => ts('Name'),
188 'description' => 'Variable name/programmatic handle for this set of price fields.',
191 'size' => CRM_Utils_Type
::HUGE
,
192 'table_name' => 'civicrm_price_set',
193 'entity' => 'PriceSet',
194 'bao' => 'CRM_Price_BAO_PriceSet',
202 'type' => CRM_Utils_Type
::T_STRING
,
203 'title' => ts('Price Set Title'),
204 'description' => 'Displayed title for the Price Set.',
207 'size' => CRM_Utils_Type
::HUGE
,
208 'table_name' => 'civicrm_price_set',
209 'entity' => 'PriceSet',
210 'bao' => 'CRM_Price_BAO_PriceSet',
217 'name' => 'is_active',
218 'type' => CRM_Utils_Type
::T_BOOLEAN
,
219 'title' => ts('Price Set Is Active?'),
220 'description' => 'Is this price set active',
222 'table_name' => 'civicrm_price_set',
223 'entity' => 'PriceSet',
224 'bao' => 'CRM_Price_BAO_PriceSet',
227 'type' => 'CheckBox',
231 'name' => 'help_pre',
232 'type' => CRM_Utils_Type
::T_TEXT
,
233 'title' => ts('Price Set Pre Help'),
234 'description' => 'Description and/or help text to display before fields in form.',
237 'table_name' => 'civicrm_price_set',
238 'entity' => 'PriceSet',
239 'bao' => 'CRM_Price_BAO_PriceSet',
242 'type' => 'TextArea',
246 'name' => 'help_post',
247 'type' => CRM_Utils_Type
::T_TEXT
,
248 'title' => ts('Price Set Post Help'),
249 'description' => 'Description and/or help text to display after fields in form.',
252 'table_name' => 'civicrm_price_set',
253 'entity' => 'PriceSet',
254 'bao' => 'CRM_Price_BAO_PriceSet',
257 'type' => 'TextArea',
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',
277 'type' => CRM_Utils_Type
::T_STRING
,
278 'title' => ts('Price Set Extends'),
279 'description' => 'What components are using this price set?',
282 'size' => CRM_Utils_Type
::HUGE
,
283 'table_name' => 'civicrm_price_set',
284 'entity' => 'PriceSet',
285 'bao' => 'CRM_Price_BAO_PriceSet',
290 'pseudoconstant' => [
291 'table' => 'civicrm_component',
293 'labelColumn' => 'name',
296 'financial_type_id' => [
297 'name' => 'financial_type_id',
298 'type' => CRM_Utils_Type
::T_INT
,
299 'title' => ts('Financial Type'),
300 'description' => 'FK to Financial Type(for membership price sets only).',
302 'table_name' => 'civicrm_price_set',
303 'entity' => 'PriceSet',
304 'bao' => 'CRM_Price_BAO_PriceSet',
306 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
310 'pseudoconstant' => [
311 'table' => 'civicrm_financial_type',
313 'labelColumn' => 'name',
316 'is_quick_config' => [
317 'name' => 'is_quick_config',
318 'type' => CRM_Utils_Type
::T_BOOLEAN
,
319 'title' => ts('Is Price Set Quick Config?'),
320 'description' => 'Is set if edited on Contribution or Event Page rather than through Manage Price Sets',
322 'table_name' => 'civicrm_price_set',
323 'entity' => 'PriceSet',
324 'bao' => 'CRM_Price_BAO_PriceSet',
327 'type' => 'CheckBox',
331 'name' => 'is_reserved',
332 'type' => CRM_Utils_Type
::T_BOOLEAN
,
333 'title' => ts('Price Set Is Reserved'),
334 'description' => 'Is this a predefined system price set (i.e. it can not be deleted, edited)?',
336 'table_name' => 'civicrm_price_set',
337 'entity' => 'PriceSet',
338 'bao' => 'CRM_Price_BAO_PriceSet',
341 'type' => 'CheckBox',
345 'name' => 'min_amount',
346 'type' => CRM_Utils_Type
::T_INT
,
347 'title' => ts('Minimum Amount'),
348 'description' => 'Minimum Amount required for this set.',
350 'table_name' => 'civicrm_price_set',
351 'entity' => 'PriceSet',
352 'bao' => 'CRM_Price_BAO_PriceSet',
359 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
361 return Civi
::$statics[__CLASS__
]['fields'];
365 * Return a mapping from field-name to the corresponding key (as used in fields()).
368 * Array(string $name => string $uniqueName).
370 public static function &fieldKeys() {
371 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
372 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
374 return Civi
::$statics[__CLASS__
]['fieldKeys'];
378 * Returns the names of this table
382 public static function getTableName() {
383 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
387 * Returns if this table needs to be logged
391 public function getLog() {
396 * Returns the list of fields that can be imported
398 * @param bool $prefix
402 public static function &import($prefix = FALSE) {
403 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_set', $prefix, []);
408 * Returns the list of fields that can be exported
410 * @param bool $prefix
414 public static function &export($prefix = FALSE) {
415 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_set', $prefix, []);
420 * Returns the list of indices
422 * @param bool $localize
426 public static function indices($localize = TRUE) {
433 'localizable' => FALSE,
435 'sig' => 'civicrm_price_set::1::name',
438 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;