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