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:a37bda1a3508a9195c561c2b2e4f03a7)
13 * Database access object for the PriceSetEntity entity.
15 class CRM_Price_DAO_PriceSetEntity
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_price_set_entity';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
39 * Table which uses this price set
53 * price set being used
62 public function __construct() {
63 $this->__table
= 'civicrm_price_set_entity';
64 parent
::__construct();
68 * Returns localized title of this entity.
70 public static function getEntityTitle() {
71 return ts('Price Set Entities');
75 * Returns foreign keys and entity references.
78 * [CRM_Core_Reference_Interface]
80 public static function getReferenceColumns() {
81 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
82 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
83 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'price_set_id', 'civicrm_price_set', 'id');
84 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
85 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
87 return Civi
::$statics[__CLASS__
]['links'];
91 * Returns all the column names of this table
95 public static function &fields() {
96 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
97 Civi
::$statics[__CLASS__
]['fields'] = [
100 'type' => CRM_Utils_Type
::T_INT
,
101 'title' => ts('Price Set Entity ID'),
102 'description' => ts('Price Set Entity'),
104 'where' => 'civicrm_price_set_entity.id',
105 'table_name' => 'civicrm_price_set_entity',
106 'entity' => 'PriceSetEntity',
107 'bao' => 'CRM_Price_DAO_PriceSetEntity',
112 'name' => 'entity_table',
113 'type' => CRM_Utils_Type
::T_STRING
,
114 'title' => ts('Entity Table'),
115 'description' => ts('Table which uses this price set'),
118 'size' => CRM_Utils_Type
::BIG
,
119 'where' => 'civicrm_price_set_entity.entity_table',
120 'table_name' => 'civicrm_price_set_entity',
121 'entity' => 'PriceSetEntity',
122 'bao' => 'CRM_Price_DAO_PriceSetEntity',
127 'name' => 'entity_id',
128 'type' => CRM_Utils_Type
::T_INT
,
129 'title' => ts('Entity IF'),
130 'description' => ts('Item in table'),
132 'where' => 'civicrm_price_set_entity.entity_id',
133 'table_name' => 'civicrm_price_set_entity',
134 'entity' => 'PriceSetEntity',
135 'bao' => 'CRM_Price_DAO_PriceSetEntity',
140 'name' => 'price_set_id',
141 'type' => CRM_Utils_Type
::T_INT
,
142 'title' => ts('Price Set'),
143 'description' => ts('price set being used'),
145 'where' => 'civicrm_price_set_entity.price_set_id',
146 'table_name' => 'civicrm_price_set_entity',
147 'entity' => 'PriceSetEntity',
148 'bao' => 'CRM_Price_DAO_PriceSetEntity',
150 'FKClassName' => 'CRM_Price_DAO_PriceSet',
151 'pseudoconstant' => [
152 'table' => 'civicrm_price_set',
154 'labelColumn' => 'title',
159 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
161 return Civi
::$statics[__CLASS__
]['fields'];
165 * Return a mapping from field-name to the corresponding key (as used in fields()).
168 * Array(string $name => string $uniqueName).
170 public static function &fieldKeys() {
171 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
172 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
174 return Civi
::$statics[__CLASS__
]['fieldKeys'];
178 * Returns the names of this table
182 public static function getTableName() {
183 return self
::$_tableName;
187 * Returns if this table needs to be logged
191 public function getLog() {
196 * Returns the list of fields that can be imported
198 * @param bool $prefix
202 public static function &import($prefix = FALSE) {
203 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_set_entity', $prefix, []);
208 * Returns the list of fields that can be exported
210 * @param bool $prefix
214 public static function &export($prefix = FALSE) {
215 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_set_entity', $prefix, []);
220 * Returns the list of indices
222 * @param bool $localize
226 public static function indices($localize = TRUE) {
229 'name' => 'UI_entity',
234 'localizable' => FALSE,
236 'sig' => 'civicrm_price_set_entity::1::entity_table::entity_id',
239 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;