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:0284d1a184dd635d93dd170e94451e86)
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';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_price_set_entity';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
41 * Table which uses this price set
55 * price set being used
64 public function __construct() {
65 $this->__table
= 'civicrm_price_set_entity';
66 parent
::__construct();
70 * Returns localized title of this entity.
73 * Whether to return the plural version of the title.
75 public static function getEntityTitle($plural = FALSE) {
76 return $plural ?
ts('Price Set Entities') : ts('Price Set Entity');
80 * Returns foreign keys and entity references.
83 * [CRM_Core_Reference_Interface]
85 public static function getReferenceColumns() {
86 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
87 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
88 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'price_set_id', 'civicrm_price_set', 'id');
89 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
90 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
92 return Civi
::$statics[__CLASS__
]['links'];
96 * Returns all the column names of this table
100 public static function &fields() {
101 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
102 Civi
::$statics[__CLASS__
]['fields'] = [
105 'type' => CRM_Utils_Type
::T_INT
,
106 'title' => ts('Price Set Entity ID'),
107 'description' => ts('Price Set Entity'),
109 'where' => 'civicrm_price_set_entity.id',
110 'table_name' => 'civicrm_price_set_entity',
111 'entity' => 'PriceSetEntity',
112 'bao' => 'CRM_Price_DAO_PriceSetEntity',
117 'name' => 'entity_table',
118 'type' => CRM_Utils_Type
::T_STRING
,
119 'title' => ts('Entity Table'),
120 'description' => ts('Table which uses this price set'),
123 'size' => CRM_Utils_Type
::BIG
,
124 'where' => 'civicrm_price_set_entity.entity_table',
125 'table_name' => 'civicrm_price_set_entity',
126 'entity' => 'PriceSetEntity',
127 'bao' => 'CRM_Price_DAO_PriceSetEntity',
132 'name' => 'entity_id',
133 'type' => CRM_Utils_Type
::T_INT
,
134 'title' => ts('Entity IF'),
135 'description' => ts('Item in table'),
137 'where' => 'civicrm_price_set_entity.entity_id',
138 'table_name' => 'civicrm_price_set_entity',
139 'entity' => 'PriceSetEntity',
140 'bao' => 'CRM_Price_DAO_PriceSetEntity',
145 'name' => 'price_set_id',
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('Price Set'),
148 'description' => ts('price set being used'),
150 'where' => 'civicrm_price_set_entity.price_set_id',
151 'table_name' => 'civicrm_price_set_entity',
152 'entity' => 'PriceSetEntity',
153 'bao' => 'CRM_Price_DAO_PriceSetEntity',
155 'FKClassName' => 'CRM_Price_DAO_PriceSet',
156 'pseudoconstant' => [
157 'table' => 'civicrm_price_set',
159 'labelColumn' => 'title',
164 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
166 return Civi
::$statics[__CLASS__
]['fields'];
170 * Return a mapping from field-name to the corresponding key (as used in fields()).
173 * Array(string $name => string $uniqueName).
175 public static function &fieldKeys() {
176 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
177 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
179 return Civi
::$statics[__CLASS__
]['fieldKeys'];
183 * Returns the names of this table
187 public static function getTableName() {
188 return self
::$_tableName;
192 * Returns if this table needs to be logged
196 public function getLog() {
201 * Returns the list of fields that can be imported
203 * @param bool $prefix
207 public static function &import($prefix = FALSE) {
208 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_set_entity', $prefix, []);
213 * Returns the list of fields that can be exported
215 * @param bool $prefix
219 public static function &export($prefix = FALSE) {
220 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_set_entity', $prefix, []);
225 * Returns the list of indices
227 * @param bool $localize
231 public static function indices($localize = TRUE) {
234 'name' => 'UI_entity',
239 'localizable' => FALSE,
241 'sig' => 'civicrm_price_set_entity::1::entity_table::entity_id',
244 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;