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:a582c36064eb9613d9172b4eebcbc37e)
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;
37 * @var int|string|null
38 * (SQL type: int unsigned)
39 * Note that values will be retrieved from the database as a string.
44 * Table which uses this price set
47 * (SQL type: varchar(64))
48 * Note that values will be retrieved from the database as a string.
56 * (SQL type: int unsigned)
57 * Note that values will be retrieved from the database as a string.
62 * price set being used
65 * (SQL type: int unsigned)
66 * Note that values will be retrieved from the database as a string.
73 public function __construct() {
74 $this->__table
= 'civicrm_price_set_entity';
75 parent
::__construct();
79 * Returns localized title of this entity.
82 * Whether to return the plural version of the title.
84 public static function getEntityTitle($plural = FALSE) {
85 return $plural ?
ts('Price Set Entities') : ts('Price Set Entity');
89 * Returns foreign keys and entity references.
92 * [CRM_Core_Reference_Interface]
94 public static function getReferenceColumns() {
95 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
96 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
97 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'price_set_id', 'civicrm_price_set', 'id');
98 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
99 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
101 return Civi
::$statics[__CLASS__
]['links'];
105 * Returns all the column names of this table
109 public static function &fields() {
110 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
111 Civi
::$statics[__CLASS__
]['fields'] = [
114 'type' => CRM_Utils_Type
::T_INT
,
115 'title' => ts('Price Set Entity ID'),
116 'description' => ts('Price Set Entity'),
118 'where' => 'civicrm_price_set_entity.id',
119 'table_name' => 'civicrm_price_set_entity',
120 'entity' => 'PriceSetEntity',
121 'bao' => 'CRM_Price_DAO_PriceSetEntity',
130 'name' => 'entity_table',
131 'type' => CRM_Utils_Type
::T_STRING
,
132 'title' => ts('Entity Table'),
133 'description' => ts('Table which uses this price set'),
136 'size' => CRM_Utils_Type
::BIG
,
137 'where' => 'civicrm_price_set_entity.entity_table',
138 'table_name' => 'civicrm_price_set_entity',
139 'entity' => 'PriceSetEntity',
140 'bao' => 'CRM_Price_DAO_PriceSetEntity',
145 'name' => 'entity_id',
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('Entity IF'),
148 'description' => ts('Item in table'),
150 'where' => 'civicrm_price_set_entity.entity_id',
151 'table_name' => 'civicrm_price_set_entity',
152 'entity' => 'PriceSetEntity',
153 'bao' => 'CRM_Price_DAO_PriceSetEntity',
158 'name' => 'price_set_id',
159 'type' => CRM_Utils_Type
::T_INT
,
160 'title' => ts('Price Set ID'),
161 'description' => ts('price set being used'),
163 'where' => 'civicrm_price_set_entity.price_set_id',
164 'table_name' => 'civicrm_price_set_entity',
165 'entity' => 'PriceSetEntity',
166 'bao' => 'CRM_Price_DAO_PriceSetEntity',
168 'FKClassName' => 'CRM_Price_DAO_PriceSet',
170 'label' => ts("Price Set"),
172 'pseudoconstant' => [
173 'table' => 'civicrm_price_set',
175 'labelColumn' => 'title',
180 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
182 return Civi
::$statics[__CLASS__
]['fields'];
186 * Return a mapping from field-name to the corresponding key (as used in fields()).
189 * Array(string $name => string $uniqueName).
191 public static function &fieldKeys() {
192 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
193 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
195 return Civi
::$statics[__CLASS__
]['fieldKeys'];
199 * Returns the names of this table
203 public static function getTableName() {
204 return self
::$_tableName;
208 * Returns if this table needs to be logged
212 public function getLog() {
217 * Returns the list of fields that can be imported
219 * @param bool $prefix
223 public static function &import($prefix = FALSE) {
224 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_set_entity', $prefix, []);
229 * Returns the list of fields that can be exported
231 * @param bool $prefix
235 public static function &export($prefix = FALSE) {
236 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_set_entity', $prefix, []);
241 * Returns the list of indices
243 * @param bool $localize
247 public static function indices($localize = TRUE) {
250 'name' => 'UI_entity',
255 'localizable' => FALSE,
257 'sig' => 'civicrm_price_set_entity::1::entity_table::entity_id',
260 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;