Merge pull request #22664 from braders/membershipview-default-values
[civicrm-core.git] / CRM / Core / DAO / LocBlock.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Core/LocBlock.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:4153042d9ec41d2841dc085180f6e16b)
10 */
11
12 /**
13 * Database access object for the LocBlock entity.
14 */
15 class CRM_Core_DAO_LocBlock extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '2.0';
18
19 /**
20 * Static instance to hold the table name.
21 *
22 * @var string
23 */
24 public static $_tableName = 'civicrm_loc_block';
25
26 /**
27 * Icon associated with this entity.
28 *
29 * @var string
30 */
31 public static $_icon = 'fa-map-o';
32
33 /**
34 * Should CiviCRM log any modifications to this table in the civicrm_log table.
35 *
36 * @var bool
37 */
38 public static $_log = TRUE;
39
40 /**
41 * Unique ID
42 *
43 * @var int|string|null
44 * (SQL type: int unsigned)
45 * Note that values will be retrieved from the database as a string.
46 */
47 public $id;
48
49 /**
50 * @var int|string|null
51 * (SQL type: int unsigned)
52 * Note that values will be retrieved from the database as a string.
53 */
54 public $address_id;
55
56 /**
57 * @var int|string|null
58 * (SQL type: int unsigned)
59 * Note that values will be retrieved from the database as a string.
60 */
61 public $email_id;
62
63 /**
64 * @var int|string|null
65 * (SQL type: int unsigned)
66 * Note that values will be retrieved from the database as a string.
67 */
68 public $phone_id;
69
70 /**
71 * @var int|string|null
72 * (SQL type: int unsigned)
73 * Note that values will be retrieved from the database as a string.
74 */
75 public $im_id;
76
77 /**
78 * @var int|string|null
79 * (SQL type: int unsigned)
80 * Note that values will be retrieved from the database as a string.
81 */
82 public $address_2_id;
83
84 /**
85 * @var int|string|null
86 * (SQL type: int unsigned)
87 * Note that values will be retrieved from the database as a string.
88 */
89 public $email_2_id;
90
91 /**
92 * @var int|string|null
93 * (SQL type: int unsigned)
94 * Note that values will be retrieved from the database as a string.
95 */
96 public $phone_2_id;
97
98 /**
99 * @var int|string|null
100 * (SQL type: int unsigned)
101 * Note that values will be retrieved from the database as a string.
102 */
103 public $im_2_id;
104
105 /**
106 * Class constructor.
107 */
108 public function __construct() {
109 $this->__table = 'civicrm_loc_block';
110 parent::__construct();
111 }
112
113 /**
114 * Returns localized title of this entity.
115 *
116 * @param bool $plural
117 * Whether to return the plural version of the title.
118 */
119 public static function getEntityTitle($plural = FALSE) {
120 return $plural ? ts('Locations') : ts('Location');
121 }
122
123 /**
124 * Returns foreign keys and entity references.
125 *
126 * @return array
127 * [CRM_Core_Reference_Interface]
128 */
129 public static function getReferenceColumns() {
130 if (!isset(Civi::$statics[__CLASS__]['links'])) {
131 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
132 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'address_id', 'civicrm_address', 'id');
133 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'email_id', 'civicrm_email', 'id');
134 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'phone_id', 'civicrm_phone', 'id');
135 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'im_id', 'civicrm_im', 'id');
136 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'address_2_id', 'civicrm_address', 'id');
137 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'email_2_id', 'civicrm_email', 'id');
138 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'phone_2_id', 'civicrm_phone', 'id');
139 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'im_2_id', 'civicrm_im', 'id');
140 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
141 }
142 return Civi::$statics[__CLASS__]['links'];
143 }
144
145 /**
146 * Returns all the column names of this table
147 *
148 * @return array
149 */
150 public static function &fields() {
151 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
152 Civi::$statics[__CLASS__]['fields'] = [
153 'id' => [
154 'name' => 'id',
155 'type' => CRM_Utils_Type::T_INT,
156 'title' => ts('Location Block ID'),
157 'description' => ts('Unique ID'),
158 'required' => TRUE,
159 'where' => 'civicrm_loc_block.id',
160 'table_name' => 'civicrm_loc_block',
161 'entity' => 'LocBlock',
162 'bao' => 'CRM_Core_DAO_LocBlock',
163 'localizable' => 0,
164 'html' => [
165 'type' => 'Number',
166 ],
167 'readonly' => TRUE,
168 'add' => '2.0',
169 ],
170 'address_id' => [
171 'name' => 'address_id',
172 'type' => CRM_Utils_Type::T_INT,
173 'title' => ts('Address ID'),
174 'where' => 'civicrm_loc_block.address_id',
175 'table_name' => 'civicrm_loc_block',
176 'entity' => 'LocBlock',
177 'bao' => 'CRM_Core_DAO_LocBlock',
178 'localizable' => 0,
179 'FKClassName' => 'CRM_Core_DAO_Address',
180 'html' => [
181 'label' => ts("Address"),
182 ],
183 'add' => '2.0',
184 ],
185 'email_id' => [
186 'name' => 'email_id',
187 'type' => CRM_Utils_Type::T_INT,
188 'title' => ts('Email ID'),
189 'where' => 'civicrm_loc_block.email_id',
190 'table_name' => 'civicrm_loc_block',
191 'entity' => 'LocBlock',
192 'bao' => 'CRM_Core_DAO_LocBlock',
193 'localizable' => 0,
194 'FKClassName' => 'CRM_Core_DAO_Email',
195 'html' => [
196 'label' => ts("Email"),
197 ],
198 'add' => '2.0',
199 ],
200 'phone_id' => [
201 'name' => 'phone_id',
202 'type' => CRM_Utils_Type::T_INT,
203 'title' => ts('Phone ID'),
204 'where' => 'civicrm_loc_block.phone_id',
205 'table_name' => 'civicrm_loc_block',
206 'entity' => 'LocBlock',
207 'bao' => 'CRM_Core_DAO_LocBlock',
208 'localizable' => 0,
209 'FKClassName' => 'CRM_Core_DAO_Phone',
210 'html' => [
211 'label' => ts("Phone"),
212 ],
213 'add' => '2.0',
214 ],
215 'im_id' => [
216 'name' => 'im_id',
217 'type' => CRM_Utils_Type::T_INT,
218 'title' => ts('IM ID'),
219 'where' => 'civicrm_loc_block.im_id',
220 'table_name' => 'civicrm_loc_block',
221 'entity' => 'LocBlock',
222 'bao' => 'CRM_Core_DAO_LocBlock',
223 'localizable' => 0,
224 'FKClassName' => 'CRM_Core_DAO_IM',
225 'html' => [
226 'label' => ts("Instant Messenger"),
227 ],
228 'add' => '2.0',
229 ],
230 'address_2_id' => [
231 'name' => 'address_2_id',
232 'type' => CRM_Utils_Type::T_INT,
233 'title' => ts('Address 2 ID'),
234 'where' => 'civicrm_loc_block.address_2_id',
235 'table_name' => 'civicrm_loc_block',
236 'entity' => 'LocBlock',
237 'bao' => 'CRM_Core_DAO_LocBlock',
238 'localizable' => 0,
239 'FKClassName' => 'CRM_Core_DAO_Address',
240 'html' => [
241 'label' => ts("Address 2"),
242 ],
243 'add' => '2.0',
244 ],
245 'email_2_id' => [
246 'name' => 'email_2_id',
247 'type' => CRM_Utils_Type::T_INT,
248 'title' => ts('Email 2 ID'),
249 'where' => 'civicrm_loc_block.email_2_id',
250 'table_name' => 'civicrm_loc_block',
251 'entity' => 'LocBlock',
252 'bao' => 'CRM_Core_DAO_LocBlock',
253 'localizable' => 0,
254 'FKClassName' => 'CRM_Core_DAO_Email',
255 'html' => [
256 'label' => ts("Email 2"),
257 ],
258 'add' => '2.0',
259 ],
260 'phone_2_id' => [
261 'name' => 'phone_2_id',
262 'type' => CRM_Utils_Type::T_INT,
263 'title' => ts('Phone 2 ID'),
264 'where' => 'civicrm_loc_block.phone_2_id',
265 'table_name' => 'civicrm_loc_block',
266 'entity' => 'LocBlock',
267 'bao' => 'CRM_Core_DAO_LocBlock',
268 'localizable' => 0,
269 'FKClassName' => 'CRM_Core_DAO_Phone',
270 'html' => [
271 'label' => ts("Phone 2"),
272 ],
273 'add' => '2.0',
274 ],
275 'im_2_id' => [
276 'name' => 'im_2_id',
277 'type' => CRM_Utils_Type::T_INT,
278 'title' => ts('IM 2 ID'),
279 'where' => 'civicrm_loc_block.im_2_id',
280 'table_name' => 'civicrm_loc_block',
281 'entity' => 'LocBlock',
282 'bao' => 'CRM_Core_DAO_LocBlock',
283 'localizable' => 0,
284 'FKClassName' => 'CRM_Core_DAO_IM',
285 'html' => [
286 'label' => ts("Instant Messenger 2"),
287 ],
288 'add' => '2.0',
289 ],
290 ];
291 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
292 }
293 return Civi::$statics[__CLASS__]['fields'];
294 }
295
296 /**
297 * Return a mapping from field-name to the corresponding key (as used in fields()).
298 *
299 * @return array
300 * Array(string $name => string $uniqueName).
301 */
302 public static function &fieldKeys() {
303 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
304 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
305 }
306 return Civi::$statics[__CLASS__]['fieldKeys'];
307 }
308
309 /**
310 * Returns the names of this table
311 *
312 * @return string
313 */
314 public static function getTableName() {
315 return self::$_tableName;
316 }
317
318 /**
319 * Returns if this table needs to be logged
320 *
321 * @return bool
322 */
323 public function getLog() {
324 return self::$_log;
325 }
326
327 /**
328 * Returns the list of fields that can be imported
329 *
330 * @param bool $prefix
331 *
332 * @return array
333 */
334 public static function &import($prefix = FALSE) {
335 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'loc_block', $prefix, []);
336 return $r;
337 }
338
339 /**
340 * Returns the list of fields that can be exported
341 *
342 * @param bool $prefix
343 *
344 * @return array
345 */
346 public static function &export($prefix = FALSE) {
347 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'loc_block', $prefix, []);
348 return $r;
349 }
350
351 /**
352 * Returns the list of indices
353 *
354 * @param bool $localize
355 *
356 * @return array
357 */
358 public static function indices($localize = TRUE) {
359 $indices = [];
360 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
361 }
362
363 }