Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
6b83d5bd | 5 | * @copyright CiviCRM LLC (c) 2004-2019 |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Price/PriceSetEntity.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
e380ee3b | 9 | * (GenCodeChecksum:ba2a78bcd5c6c34e2a81d1bcef776ca3) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the PriceSetEntity entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Price_DAO_PriceSetEntity extends CRM_Core_DAO { |
c3fc2621 | 16 | |
e501603b | 17 | /** |
f41f0342 | 18 | * Static instance to hold the table name. |
e501603b TO |
19 | * |
20 | * @var string | |
21 | */ | |
fa45b5b9 | 22 | public static $_tableName = 'civicrm_price_set_entity'; |
c3fc2621 | 23 | |
e501603b | 24 | /** |
f41f0342 | 25 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 26 | * |
c3fc2621 | 27 | * @var bool |
e501603b | 28 | */ |
fa45b5b9 | 29 | public static $_log = TRUE; |
c3fc2621 | 30 | |
e501603b TO |
31 | /** |
32 | * Price Set Entity | |
33 | * | |
34 | * @var int unsigned | |
35 | */ | |
36 | public $id; | |
c3fc2621 | 37 | |
e501603b TO |
38 | /** |
39 | * Table which uses this price set | |
40 | * | |
41 | * @var string | |
42 | */ | |
43 | public $entity_table; | |
c3fc2621 | 44 | |
e501603b TO |
45 | /** |
46 | * Item in table | |
47 | * | |
48 | * @var int unsigned | |
49 | */ | |
50 | public $entity_id; | |
c3fc2621 | 51 | |
e501603b TO |
52 | /** |
53 | * price set being used | |
54 | * | |
55 | * @var int unsigned | |
56 | */ | |
57 | public $price_set_id; | |
c3fc2621 | 58 | |
e501603b | 59 | /** |
f41f0342 | 60 | * Class constructor. |
e501603b | 61 | */ |
c3fc2621 | 62 | public function __construct() { |
e501603b TO |
63 | $this->__table = 'civicrm_price_set_entity'; |
64 | parent::__construct(); | |
65 | } | |
c3fc2621 | 66 | |
e501603b | 67 | /** |
f41f0342 | 68 | * Returns foreign keys and entity references. |
e501603b TO |
69 | * |
70 | * @return array | |
71 | * [CRM_Core_Reference_Interface] | |
72 | */ | |
c3fc2621 | 73 | public static function getReferenceColumns() { |
346aaaba | 74 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
fa45b5b9 | 75 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 CW |
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'); | |
346aaaba | 78 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 79 | } |
346aaaba | 80 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 81 | } |
c3fc2621 | 82 | |
e501603b TO |
83 | /** |
84 | * Returns all the column names of this table | |
85 | * | |
86 | * @return array | |
87 | */ | |
c3fc2621 | 88 | public static function &fields() { |
346aaaba | 89 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
90 | Civi::$statics[__CLASS__]['fields'] = [ |
91 | 'id' => [ | |
e501603b TO |
92 | 'name' => 'id', |
93 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 94 | 'title' => ts('Price Set Entity ID'), |
215b423e | 95 | 'description' => ts('Price Set Entity'), |
c3fc2621 | 96 | 'required' => TRUE, |
a36434b9 | 97 | 'where' => 'civicrm_price_set_entity.id', |
522a26c9 | 98 | 'table_name' => 'civicrm_price_set_entity', |
99 | 'entity' => 'PriceSetEntity', | |
100 | 'bao' => 'CRM_Price_DAO_PriceSetEntity', | |
6a7e5e5d | 101 | 'localizable' => 0, |
c3fc2621 CW |
102 | ], |
103 | 'entity_table' => [ | |
e501603b TO |
104 | 'name' => 'entity_table', |
105 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 106 | 'title' => ts('Entity Table'), |
215b423e | 107 | 'description' => ts('Table which uses this price set'), |
c3fc2621 | 108 | 'required' => TRUE, |
e501603b TO |
109 | 'maxlength' => 64, |
110 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 111 | 'where' => 'civicrm_price_set_entity.entity_table', |
522a26c9 | 112 | 'table_name' => 'civicrm_price_set_entity', |
113 | 'entity' => 'PriceSetEntity', | |
114 | 'bao' => 'CRM_Price_DAO_PriceSetEntity', | |
6a7e5e5d | 115 | 'localizable' => 0, |
c3fc2621 CW |
116 | ], |
117 | 'entity_id' => [ | |
e501603b TO |
118 | 'name' => 'entity_id', |
119 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 120 | 'title' => ts('Entity IF'), |
215b423e | 121 | 'description' => ts('Item in table'), |
c3fc2621 | 122 | 'required' => TRUE, |
a36434b9 | 123 | 'where' => 'civicrm_price_set_entity.entity_id', |
522a26c9 | 124 | 'table_name' => 'civicrm_price_set_entity', |
125 | 'entity' => 'PriceSetEntity', | |
126 | 'bao' => 'CRM_Price_DAO_PriceSetEntity', | |
6a7e5e5d | 127 | 'localizable' => 0, |
c3fc2621 CW |
128 | ], |
129 | 'price_set_id' => [ | |
e501603b TO |
130 | 'name' => 'price_set_id', |
131 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 132 | 'title' => ts('Price Set'), |
215b423e | 133 | 'description' => ts('price set being used'), |
c3fc2621 | 134 | 'required' => TRUE, |
a36434b9 | 135 | 'where' => 'civicrm_price_set_entity.price_set_id', |
522a26c9 | 136 | 'table_name' => 'civicrm_price_set_entity', |
137 | 'entity' => 'PriceSetEntity', | |
138 | 'bao' => 'CRM_Price_DAO_PriceSetEntity', | |
6a7e5e5d | 139 | 'localizable' => 0, |
e501603b | 140 | 'FKClassName' => 'CRM_Price_DAO_PriceSet', |
c3fc2621 CW |
141 | ], |
142 | ]; | |
346aaaba | 143 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 144 | } |
346aaaba | 145 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 146 | } |
c3fc2621 | 147 | |
e501603b | 148 | /** |
bd8e0b14 | 149 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
150 | * |
151 | * @return array | |
bd8e0b14 | 152 | * Array(string $name => string $uniqueName). |
e501603b | 153 | */ |
c3fc2621 | 154 | public static function &fieldKeys() { |
bd8e0b14 TO |
155 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
156 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 157 | } |
bd8e0b14 | 158 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 159 | } |
c3fc2621 | 160 | |
e501603b TO |
161 | /** |
162 | * Returns the names of this table | |
163 | * | |
164 | * @return string | |
165 | */ | |
c3fc2621 | 166 | public static function getTableName() { |
e501603b TO |
167 | return self::$_tableName; |
168 | } | |
c3fc2621 | 169 | |
e501603b TO |
170 | /** |
171 | * Returns if this table needs to be logged | |
172 | * | |
c3fc2621 | 173 | * @return bool |
e501603b | 174 | */ |
c3fc2621 | 175 | public function getLog() { |
e501603b TO |
176 | return self::$_log; |
177 | } | |
c3fc2621 | 178 | |
e501603b TO |
179 | /** |
180 | * Returns the list of fields that can be imported | |
181 | * | |
182 | * @param bool $prefix | |
183 | * | |
184 | * @return array | |
185 | */ | |
c3fc2621 CW |
186 | public static function &import($prefix = FALSE) { |
187 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'price_set_entity', $prefix, []); | |
60808919 | 188 | return $r; |
e501603b | 189 | } |
c3fc2621 | 190 | |
e501603b TO |
191 | /** |
192 | * Returns the list of fields that can be exported | |
193 | * | |
194 | * @param bool $prefix | |
195 | * | |
196 | * @return array | |
197 | */ | |
c3fc2621 CW |
198 | public static function &export($prefix = FALSE) { |
199 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'price_set_entity', $prefix, []); | |
60808919 | 200 | return $r; |
e501603b | 201 | } |
c3fc2621 | 202 | |
e7a6b91a AS |
203 | /** |
204 | * Returns the list of indices | |
c3fc2621 CW |
205 | * |
206 | * @param bool $localize | |
207 | * | |
208 | * @return array | |
e7a6b91a AS |
209 | */ |
210 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
211 | $indices = [ |
212 | 'UI_entity' => [ | |
e7a6b91a | 213 | 'name' => 'UI_entity', |
c3fc2621 | 214 | 'field' => [ |
e7a6b91a AS |
215 | 0 => 'entity_table', |
216 | 1 => 'entity_id', | |
c3fc2621 CW |
217 | ], |
218 | 'localizable' => FALSE, | |
219 | 'unique' => TRUE, | |
e7a6b91a | 220 | 'sig' => 'civicrm_price_set_entity::1::entity_table::entity_id', |
c3fc2621 CW |
221 | ], |
222 | ]; | |
e7a6b91a AS |
223 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
224 | } | |
c3fc2621 | 225 | |
e501603b | 226 | } |