5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Price/PriceSetEntity.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:725ada34ef925d58d65d76995dba0cfb)
13 * Database access object for the PriceSetEntity entity.
15 class CRM_Price_DAO_PriceSetEntity
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.8';
18 const COMPONENT
= 'CiviContribute';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_price_set_entity';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = TRUE;
42 * Table which uses this price set
56 * price set being used
65 public function __construct() {
66 $this->__table
= 'civicrm_price_set_entity';
67 parent
::__construct();
71 * Returns localized title of this entity.
74 * Whether to return the plural version of the title.
76 public static function getEntityTitle($plural = FALSE) {
77 return $plural ?
ts('Price Set Entities') : ts('Price Set Entity');
81 * Returns foreign keys and entity references.
84 * [CRM_Core_Reference_Interface]
86 public static function getReferenceColumns() {
87 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
88 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
89 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'price_set_id', 'civicrm_price_set', 'id');
90 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
91 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
93 return Civi
::$statics[__CLASS__
]['links'];
97 * Returns all the column names of this table
101 public static function &fields() {
102 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
103 Civi
::$statics[__CLASS__
]['fields'] = [
106 'type' => CRM_Utils_Type
::T_INT
,
107 'title' => ts('Price Set Entity ID'),
108 'description' => ts('Price Set Entity'),
110 'where' => 'civicrm_price_set_entity.id',
111 'table_name' => 'civicrm_price_set_entity',
112 'entity' => 'PriceSetEntity',
113 'bao' => 'CRM_Price_DAO_PriceSetEntity',
122 'name' => 'entity_table',
123 'type' => CRM_Utils_Type
::T_STRING
,
124 'title' => ts('Entity Table'),
125 'description' => ts('Table which uses this price set'),
128 'size' => CRM_Utils_Type
::BIG
,
129 'where' => 'civicrm_price_set_entity.entity_table',
130 'table_name' => 'civicrm_price_set_entity',
131 'entity' => 'PriceSetEntity',
132 'bao' => 'CRM_Price_DAO_PriceSetEntity',
137 'name' => 'entity_id',
138 'type' => CRM_Utils_Type
::T_INT
,
139 'title' => ts('Entity IF'),
140 'description' => ts('Item in table'),
142 'where' => 'civicrm_price_set_entity.entity_id',
143 'table_name' => 'civicrm_price_set_entity',
144 'entity' => 'PriceSetEntity',
145 'bao' => 'CRM_Price_DAO_PriceSetEntity',
150 'name' => 'price_set_id',
151 'type' => CRM_Utils_Type
::T_INT
,
152 'title' => ts('Price Set ID'),
153 'description' => ts('price set being used'),
155 'where' => 'civicrm_price_set_entity.price_set_id',
156 'table_name' => 'civicrm_price_set_entity',
157 'entity' => 'PriceSetEntity',
158 'bao' => 'CRM_Price_DAO_PriceSetEntity',
160 'FKClassName' => 'CRM_Price_DAO_PriceSet',
162 'label' => ts("Price Set"),
164 'pseudoconstant' => [
165 'table' => 'civicrm_price_set',
167 'labelColumn' => 'title',
172 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
174 return Civi
::$statics[__CLASS__
]['fields'];
178 * Return a mapping from field-name to the corresponding key (as used in fields()).
181 * Array(string $name => string $uniqueName).
183 public static function &fieldKeys() {
184 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
185 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
187 return Civi
::$statics[__CLASS__
]['fieldKeys'];
191 * Returns the names of this table
195 public static function getTableName() {
196 return self
::$_tableName;
200 * Returns if this table needs to be logged
204 public function getLog() {
209 * Returns the list of fields that can be imported
211 * @param bool $prefix
215 public static function &import($prefix = FALSE) {
216 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_set_entity', $prefix, []);
221 * Returns the list of fields that can be exported
223 * @param bool $prefix
227 public static function &export($prefix = FALSE) {
228 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_set_entity', $prefix, []);
233 * Returns the list of indices
235 * @param bool $localize
239 public static function indices($localize = TRUE) {
242 'name' => 'UI_entity',
247 'localizable' => FALSE,
249 'sig' => 'civicrm_price_set_entity::1::entity_table::entity_id',
252 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;