5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Price/PriceSetEntity.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:6113d40ca79159b19d2c915aeb620e7c)
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 static $_tableName = 'civicrm_price_set_entity';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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' => 'Price Set Entity',
97 'table_name' => 'civicrm_price_set_entity',
98 'entity' => 'PriceSetEntity',
99 'bao' => 'CRM_Price_DAO_PriceSetEntity',
103 'name' => 'entity_table',
104 'type' => CRM_Utils_Type
::T_STRING
,
105 'title' => ts('Entity Table'),
106 'description' => 'Table which uses this price set',
109 'size' => CRM_Utils_Type
::BIG
,
110 'table_name' => 'civicrm_price_set_entity',
111 'entity' => 'PriceSetEntity',
112 'bao' => 'CRM_Price_DAO_PriceSetEntity',
116 'name' => 'entity_id',
117 'type' => CRM_Utils_Type
::T_INT
,
118 'title' => ts('Entity IF'),
119 'description' => 'Item in table',
121 'table_name' => 'civicrm_price_set_entity',
122 'entity' => 'PriceSetEntity',
123 'bao' => 'CRM_Price_DAO_PriceSetEntity',
127 'name' => 'price_set_id',
128 'type' => CRM_Utils_Type
::T_INT
,
129 'title' => ts('Price Set'),
130 'description' => 'price set being used',
132 'table_name' => 'civicrm_price_set_entity',
133 'entity' => 'PriceSetEntity',
134 'bao' => 'CRM_Price_DAO_PriceSetEntity',
136 'FKClassName' => 'CRM_Price_DAO_PriceSet',
139 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
141 return Civi
::$statics[__CLASS__
]['fields'];
145 * Return a mapping from field-name to the corresponding key (as used in fields()).
148 * Array(string $name => string $uniqueName).
150 public static function &fieldKeys() {
151 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
152 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
154 return Civi
::$statics[__CLASS__
]['fieldKeys'];
158 * Returns the names of this table
162 public static function getTableName() {
163 return self
::$_tableName;
167 * Returns if this table needs to be logged
171 public function getLog() {
176 * Returns the list of fields that can be imported
178 * @param bool $prefix
182 public static function &import($prefix = FALSE) {
183 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'price_set_entity', $prefix, []);
188 * Returns the list of fields that can be exported
190 * @param bool $prefix
194 public static function &export($prefix = FALSE) {
195 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'price_set_entity', $prefix, []);
200 * Returns the list of indices
202 * @param bool $localize
206 public static function indices($localize = TRUE) {
209 'name' => 'UI_entity',
214 'localizable' => FALSE,
216 'sig' => 'civicrm_price_set_entity::1::entity_table::entity_id',
219 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;