5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Price/PriceSetEntity.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:2af9002085aaf369b570094e32bff851)
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 foreign keys and entity references.
71 * [CRM_Core_Reference_Interface]
73 public static function getReferenceColumns() {
74 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
75 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
76 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'price_set_id', 'civicrm_price_set', 'id');
77 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
78 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
80 return Civi
::$statics[__CLASS__
]['links'];
84 * Returns all the column names of this table
88 public static function &fields() {
89 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
90 Civi
::$statics[__CLASS__
]['fields'] = [
93 'type' => CRM_Utils_Type
::T_INT
,
94 'title' => ts('Price Set Entity ID'),
95 'description' => ts('Price Set Entity'),
97 'where' => 'civicrm_price_set_entity.id',
98 'table_name' => 'civicrm_price_set_entity',
99 'entity' => 'PriceSetEntity',
100 'bao' => 'CRM_Price_DAO_PriceSetEntity',
104 'name' => 'entity_table',
105 'type' => CRM_Utils_Type
::T_STRING
,
106 'title' => ts('Entity Table'),
107 'description' => ts('Table which uses this price set'),
110 'size' => CRM_Utils_Type
::BIG
,
111 'where' => 'civicrm_price_set_entity.entity_table',
112 'table_name' => 'civicrm_price_set_entity',
113 'entity' => 'PriceSetEntity',
114 'bao' => 'CRM_Price_DAO_PriceSetEntity',
118 'name' => 'entity_id',
119 'type' => CRM_Utils_Type
::T_INT
,
120 'title' => ts('Entity IF'),
121 'description' => ts('Item in table'),
123 'where' => 'civicrm_price_set_entity.entity_id',
124 'table_name' => 'civicrm_price_set_entity',
125 'entity' => 'PriceSetEntity',
126 'bao' => 'CRM_Price_DAO_PriceSetEntity',
130 'name' => 'price_set_id',
131 'type' => CRM_Utils_Type
::T_INT
,
132 'title' => ts('Price Set'),
133 'description' => ts('price set being used'),
135 'where' => 'civicrm_price_set_entity.price_set_id',
136 'table_name' => 'civicrm_price_set_entity',
137 'entity' => 'PriceSetEntity',
138 'bao' => 'CRM_Price_DAO_PriceSetEntity',
140 'FKClassName' => 'CRM_Price_DAO_PriceSet',
143 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
145 return Civi
::$statics[__CLASS__
]['fields'];
149 * Return a mapping from field-name to the corresponding key (as used in fields()).
152 * Array(string $name => string $uniqueName).
154 public static function &fieldKeys() {
155 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
156 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
158 return Civi
::$statics[__CLASS__
]['fieldKeys'];
162 * Returns the names of this table
166 public static function getTableName() {
167 return self
::$_tableName;
171 * Returns if this table needs to be logged
175 public function getLog() {
180 * Returns the list of fields that can be imported
182 * @param bool $prefix
186 public static function &import($prefix = FALSE) {
187 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_set_entity', $prefix, []);
192 * Returns the list of fields that can be exported
194 * @param bool $prefix
198 public static function &export($prefix = FALSE) {
199 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_set_entity', $prefix, []);
204 * Returns the list of indices
206 * @param bool $localize
210 public static function indices($localize = TRUE) {
213 'name' => 'UI_entity',
218 'localizable' => FALSE,
220 'sig' => 'civicrm_price_set_entity::1::entity_table::entity_id',
223 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;