Merge pull request #13170 from elisseck/dev/core/485
[civicrm-core.git] / CRM / Core / DAO / LocBlock.php
CommitLineData
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/Core/LocBlock.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
e380ee3b 9 * (GenCodeChecksum:cc12c8f1ddd73d6d8b1d056dd04696e9)
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 {
c3fc2621 16
e501603b 17 /**
f41f0342 18 * Static instance to hold the table name.
e501603b
TO
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_loc_block';
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 */
c3fc2621
CW
29 static $_log = TRUE;
30
e501603b
TO
31 /**
32 * Unique ID
33 *
34 * @var int unsigned
35 */
36 public $id;
c3fc2621 37
e501603b 38 /**
e501603b
TO
39 * @var int unsigned
40 */
41 public $address_id;
c3fc2621 42
e501603b 43 /**
e501603b
TO
44 * @var int unsigned
45 */
46 public $email_id;
c3fc2621 47
e501603b 48 /**
e501603b
TO
49 * @var int unsigned
50 */
51 public $phone_id;
c3fc2621 52
e501603b 53 /**
e501603b
TO
54 * @var int unsigned
55 */
56 public $im_id;
c3fc2621 57
e501603b 58 /**
e501603b
TO
59 * @var int unsigned
60 */
61 public $address_2_id;
c3fc2621 62
e501603b 63 /**
e501603b
TO
64 * @var int unsigned
65 */
66 public $email_2_id;
c3fc2621 67
e501603b 68 /**
e501603b
TO
69 * @var int unsigned
70 */
71 public $phone_2_id;
c3fc2621 72
e501603b 73 /**
e501603b
TO
74 * @var int unsigned
75 */
76 public $im_2_id;
c3fc2621 77
e501603b 78 /**
f41f0342 79 * Class constructor.
e501603b 80 */
c3fc2621 81 public function __construct() {
e501603b
TO
82 $this->__table = 'civicrm_loc_block';
83 parent::__construct();
84 }
c3fc2621 85
e501603b 86 /**
f41f0342 87 * Returns foreign keys and entity references.
e501603b
TO
88 *
89 * @return array
90 * [CRM_Core_Reference_Interface]
91 */
c3fc2621 92 public static function getReferenceColumns() {
346aaaba
TO
93 if (!isset(Civi::$statics[__CLASS__]['links'])) {
94 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
c3fc2621
CW
95 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'address_id', 'civicrm_address', 'id');
96 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'email_id', 'civicrm_email', 'id');
97 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'phone_id', 'civicrm_phone', 'id');
98 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'im_id', 'civicrm_im', 'id');
99 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'address_2_id', 'civicrm_address', 'id');
100 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'email_2_id', 'civicrm_email', 'id');
101 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'phone_2_id', 'civicrm_phone', 'id');
102 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'im_2_id', 'civicrm_im', 'id');
346aaaba 103 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 104 }
346aaaba 105 return Civi::$statics[__CLASS__]['links'];
e501603b 106 }
c3fc2621 107
e501603b
TO
108 /**
109 * Returns all the column names of this table
110 *
111 * @return array
112 */
c3fc2621 113 public static function &fields() {
346aaaba 114 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
115 Civi::$statics[__CLASS__]['fields'] = [
116 'id' => [
e501603b
TO
117 'name' => 'id',
118 'type' => CRM_Utils_Type::T_INT,
c3fc2621 119 'title' => ts('Location Block ID'),
215b423e 120 'description' => ts('Unique ID'),
c3fc2621 121 'required' => TRUE,
522a26c9 122 'table_name' => 'civicrm_loc_block',
123 'entity' => 'LocBlock',
124 'bao' => 'CRM_Core_DAO_LocBlock',
6a7e5e5d 125 'localizable' => 0,
c3fc2621
CW
126 ],
127 'address_id' => [
e501603b
TO
128 'name' => 'address_id',
129 'type' => CRM_Utils_Type::T_INT,
c3fc2621 130 'title' => ts('Location Block Address'),
522a26c9 131 'table_name' => 'civicrm_loc_block',
132 'entity' => 'LocBlock',
133 'bao' => 'CRM_Core_DAO_LocBlock',
6a7e5e5d 134 'localizable' => 0,
e501603b 135 'FKClassName' => 'CRM_Core_DAO_Address',
c3fc2621
CW
136 ],
137 'email_id' => [
e501603b
TO
138 'name' => 'email_id',
139 'type' => CRM_Utils_Type::T_INT,
c3fc2621 140 'title' => ts('Location Block Email'),
522a26c9 141 'table_name' => 'civicrm_loc_block',
142 'entity' => 'LocBlock',
143 'bao' => 'CRM_Core_DAO_LocBlock',
6a7e5e5d 144 'localizable' => 0,
e501603b 145 'FKClassName' => 'CRM_Core_DAO_Email',
c3fc2621
CW
146 ],
147 'phone_id' => [
e501603b
TO
148 'name' => 'phone_id',
149 'type' => CRM_Utils_Type::T_INT,
c3fc2621 150 'title' => ts('Location Block Phone'),
522a26c9 151 'table_name' => 'civicrm_loc_block',
152 'entity' => 'LocBlock',
153 'bao' => 'CRM_Core_DAO_LocBlock',
6a7e5e5d 154 'localizable' => 0,
e501603b 155 'FKClassName' => 'CRM_Core_DAO_Phone',
c3fc2621
CW
156 ],
157 'im_id' => [
e501603b
TO
158 'name' => 'im_id',
159 'type' => CRM_Utils_Type::T_INT,
c3fc2621 160 'title' => ts('Location Block IM'),
522a26c9 161 'table_name' => 'civicrm_loc_block',
162 'entity' => 'LocBlock',
163 'bao' => 'CRM_Core_DAO_LocBlock',
6a7e5e5d 164 'localizable' => 0,
e501603b 165 'FKClassName' => 'CRM_Core_DAO_IM',
c3fc2621
CW
166 ],
167 'address_2_id' => [
e501603b
TO
168 'name' => 'address_2_id',
169 'type' => CRM_Utils_Type::T_INT,
c3fc2621 170 'title' => ts('Location Block IM 2'),
522a26c9 171 'table_name' => 'civicrm_loc_block',
172 'entity' => 'LocBlock',
173 'bao' => 'CRM_Core_DAO_LocBlock',
6a7e5e5d 174 'localizable' => 0,
e501603b 175 'FKClassName' => 'CRM_Core_DAO_Address',
c3fc2621
CW
176 ],
177 'email_2_id' => [
e501603b
TO
178 'name' => 'email_2_id',
179 'type' => CRM_Utils_Type::T_INT,
c3fc2621 180 'title' => ts('Email 2'),
522a26c9 181 'table_name' => 'civicrm_loc_block',
182 'entity' => 'LocBlock',
183 'bao' => 'CRM_Core_DAO_LocBlock',
6a7e5e5d 184 'localizable' => 0,
e501603b 185 'FKClassName' => 'CRM_Core_DAO_Email',
c3fc2621
CW
186 ],
187 'phone_2_id' => [
e501603b
TO
188 'name' => 'phone_2_id',
189 'type' => CRM_Utils_Type::T_INT,
c3fc2621 190 'title' => ts('Phone 2'),
522a26c9 191 'table_name' => 'civicrm_loc_block',
192 'entity' => 'LocBlock',
193 'bao' => 'CRM_Core_DAO_LocBlock',
6a7e5e5d 194 'localizable' => 0,
e501603b 195 'FKClassName' => 'CRM_Core_DAO_Phone',
c3fc2621
CW
196 ],
197 'im_2_id' => [
e501603b
TO
198 'name' => 'im_2_id',
199 'type' => CRM_Utils_Type::T_INT,
c3fc2621 200 'title' => ts('Instant Messenger 2'),
522a26c9 201 'table_name' => 'civicrm_loc_block',
202 'entity' => 'LocBlock',
203 'bao' => 'CRM_Core_DAO_LocBlock',
6a7e5e5d 204 'localizable' => 0,
e501603b 205 'FKClassName' => 'CRM_Core_DAO_IM',
c3fc2621
CW
206 ],
207 ];
346aaaba 208 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 209 }
346aaaba 210 return Civi::$statics[__CLASS__]['fields'];
e501603b 211 }
c3fc2621 212
e501603b 213 /**
bd8e0b14 214 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
215 *
216 * @return array
bd8e0b14 217 * Array(string $name => string $uniqueName).
e501603b 218 */
c3fc2621 219 public static function &fieldKeys() {
bd8e0b14
TO
220 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
221 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 222 }
bd8e0b14 223 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 224 }
c3fc2621 225
e501603b
TO
226 /**
227 * Returns the names of this table
228 *
229 * @return string
230 */
c3fc2621 231 public static function getTableName() {
e501603b
TO
232 return self::$_tableName;
233 }
c3fc2621 234
e501603b
TO
235 /**
236 * Returns if this table needs to be logged
237 *
c3fc2621 238 * @return bool
e501603b 239 */
c3fc2621 240 public function getLog() {
e501603b
TO
241 return self::$_log;
242 }
c3fc2621 243
e501603b
TO
244 /**
245 * Returns the list of fields that can be imported
246 *
247 * @param bool $prefix
248 *
249 * @return array
250 */
c3fc2621
CW
251 public static function &import($prefix = FALSE) {
252 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'loc_block', $prefix, []);
60808919 253 return $r;
e501603b 254 }
c3fc2621 255
e501603b
TO
256 /**
257 * Returns the list of fields that can be exported
258 *
259 * @param bool $prefix
260 *
261 * @return array
262 */
c3fc2621
CW
263 public static function &export($prefix = FALSE) {
264 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'loc_block', $prefix, []);
60808919 265 return $r;
e501603b 266 }
c3fc2621 267
e7a6b91a
AS
268 /**
269 * Returns the list of indices
c3fc2621
CW
270 *
271 * @param bool $localize
272 *
273 * @return array
e7a6b91a
AS
274 */
275 public static function indices($localize = TRUE) {
c3fc2621 276 $indices = [];
e7a6b91a
AS
277 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
278 }
c3fc2621 279
e501603b 280}