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/Core/LocBlock.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
74db51d3 | 9 | * (GenCodeChecksum:b3cd6cc4298a1df379876cc9c96a4a6b) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the LocBlock entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class 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 | */ | |
fa45b5b9 | 22 | public 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 | */ |
fa45b5b9 | 29 | public static $_log = TRUE; |
c3fc2621 | 30 | |
e501603b TO |
31 | /** |
32 | * Unique ID | |
33 | * | |
e6ca0a57 | 34 | * @var int |
e501603b TO |
35 | */ |
36 | public $id; | |
c3fc2621 | 37 | |
e501603b | 38 | /** |
e6ca0a57 | 39 | * @var int |
e501603b TO |
40 | */ |
41 | public $address_id; | |
c3fc2621 | 42 | |
e501603b | 43 | /** |
e6ca0a57 | 44 | * @var int |
e501603b TO |
45 | */ |
46 | public $email_id; | |
c3fc2621 | 47 | |
e501603b | 48 | /** |
e6ca0a57 | 49 | * @var int |
e501603b TO |
50 | */ |
51 | public $phone_id; | |
c3fc2621 | 52 | |
e501603b | 53 | /** |
e6ca0a57 | 54 | * @var int |
e501603b TO |
55 | */ |
56 | public $im_id; | |
c3fc2621 | 57 | |
e501603b | 58 | /** |
e6ca0a57 | 59 | * @var int |
e501603b TO |
60 | */ |
61 | public $address_2_id; | |
c3fc2621 | 62 | |
e501603b | 63 | /** |
e6ca0a57 | 64 | * @var int |
e501603b TO |
65 | */ |
66 | public $email_2_id; | |
c3fc2621 | 67 | |
e501603b | 68 | /** |
e6ca0a57 | 69 | * @var int |
e501603b TO |
70 | */ |
71 | public $phone_2_id; | |
c3fc2621 | 72 | |
e501603b | 73 | /** |
e6ca0a57 | 74 | * @var int |
e501603b TO |
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 | 93 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
fa45b5b9 | 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, |
a36434b9 | 122 | 'where' => 'civicrm_loc_block.id', |
522a26c9 | 123 | 'table_name' => 'civicrm_loc_block', |
124 | 'entity' => 'LocBlock', | |
125 | 'bao' => 'CRM_Core_DAO_LocBlock', | |
6a7e5e5d | 126 | 'localizable' => 0, |
c3fc2621 CW |
127 | ], |
128 | 'address_id' => [ | |
e501603b TO |
129 | 'name' => 'address_id', |
130 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 131 | 'title' => ts('Location Block Address'), |
a36434b9 | 132 | 'where' => 'civicrm_loc_block.address_id', |
522a26c9 | 133 | 'table_name' => 'civicrm_loc_block', |
134 | 'entity' => 'LocBlock', | |
135 | 'bao' => 'CRM_Core_DAO_LocBlock', | |
6a7e5e5d | 136 | 'localizable' => 0, |
e501603b | 137 | 'FKClassName' => 'CRM_Core_DAO_Address', |
c3fc2621 CW |
138 | ], |
139 | 'email_id' => [ | |
e501603b TO |
140 | 'name' => 'email_id', |
141 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 142 | 'title' => ts('Location Block Email'), |
a36434b9 | 143 | 'where' => 'civicrm_loc_block.email_id', |
522a26c9 | 144 | 'table_name' => 'civicrm_loc_block', |
145 | 'entity' => 'LocBlock', | |
146 | 'bao' => 'CRM_Core_DAO_LocBlock', | |
6a7e5e5d | 147 | 'localizable' => 0, |
e501603b | 148 | 'FKClassName' => 'CRM_Core_DAO_Email', |
c3fc2621 CW |
149 | ], |
150 | 'phone_id' => [ | |
e501603b TO |
151 | 'name' => 'phone_id', |
152 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 153 | 'title' => ts('Location Block Phone'), |
a36434b9 | 154 | 'where' => 'civicrm_loc_block.phone_id', |
522a26c9 | 155 | 'table_name' => 'civicrm_loc_block', |
156 | 'entity' => 'LocBlock', | |
157 | 'bao' => 'CRM_Core_DAO_LocBlock', | |
6a7e5e5d | 158 | 'localizable' => 0, |
e501603b | 159 | 'FKClassName' => 'CRM_Core_DAO_Phone', |
c3fc2621 CW |
160 | ], |
161 | 'im_id' => [ | |
e501603b TO |
162 | 'name' => 'im_id', |
163 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 164 | 'title' => ts('Location Block IM'), |
a36434b9 | 165 | 'where' => 'civicrm_loc_block.im_id', |
522a26c9 | 166 | 'table_name' => 'civicrm_loc_block', |
167 | 'entity' => 'LocBlock', | |
168 | 'bao' => 'CRM_Core_DAO_LocBlock', | |
6a7e5e5d | 169 | 'localizable' => 0, |
e501603b | 170 | 'FKClassName' => 'CRM_Core_DAO_IM', |
c3fc2621 CW |
171 | ], |
172 | 'address_2_id' => [ | |
e501603b TO |
173 | 'name' => 'address_2_id', |
174 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 175 | 'title' => ts('Location Block IM 2'), |
a36434b9 | 176 | 'where' => 'civicrm_loc_block.address_2_id', |
522a26c9 | 177 | 'table_name' => 'civicrm_loc_block', |
178 | 'entity' => 'LocBlock', | |
179 | 'bao' => 'CRM_Core_DAO_LocBlock', | |
6a7e5e5d | 180 | 'localizable' => 0, |
e501603b | 181 | 'FKClassName' => 'CRM_Core_DAO_Address', |
c3fc2621 CW |
182 | ], |
183 | 'email_2_id' => [ | |
e501603b TO |
184 | 'name' => 'email_2_id', |
185 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 186 | 'title' => ts('Email 2'), |
a36434b9 | 187 | 'where' => 'civicrm_loc_block.email_2_id', |
522a26c9 | 188 | 'table_name' => 'civicrm_loc_block', |
189 | 'entity' => 'LocBlock', | |
190 | 'bao' => 'CRM_Core_DAO_LocBlock', | |
6a7e5e5d | 191 | 'localizable' => 0, |
e501603b | 192 | 'FKClassName' => 'CRM_Core_DAO_Email', |
c3fc2621 CW |
193 | ], |
194 | 'phone_2_id' => [ | |
e501603b TO |
195 | 'name' => 'phone_2_id', |
196 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 197 | 'title' => ts('Phone 2'), |
a36434b9 | 198 | 'where' => 'civicrm_loc_block.phone_2_id', |
522a26c9 | 199 | 'table_name' => 'civicrm_loc_block', |
200 | 'entity' => 'LocBlock', | |
201 | 'bao' => 'CRM_Core_DAO_LocBlock', | |
6a7e5e5d | 202 | 'localizable' => 0, |
e501603b | 203 | 'FKClassName' => 'CRM_Core_DAO_Phone', |
c3fc2621 CW |
204 | ], |
205 | 'im_2_id' => [ | |
e501603b TO |
206 | 'name' => 'im_2_id', |
207 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 208 | 'title' => ts('Instant Messenger 2'), |
a36434b9 | 209 | 'where' => 'civicrm_loc_block.im_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_IM', |
c3fc2621 CW |
215 | ], |
216 | ]; | |
346aaaba | 217 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 218 | } |
346aaaba | 219 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 220 | } |
c3fc2621 | 221 | |
e501603b | 222 | /** |
bd8e0b14 | 223 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
224 | * |
225 | * @return array | |
bd8e0b14 | 226 | * Array(string $name => string $uniqueName). |
e501603b | 227 | */ |
c3fc2621 | 228 | public static function &fieldKeys() { |
bd8e0b14 TO |
229 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
230 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 231 | } |
bd8e0b14 | 232 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 233 | } |
c3fc2621 | 234 | |
e501603b TO |
235 | /** |
236 | * Returns the names of this table | |
237 | * | |
238 | * @return string | |
239 | */ | |
c3fc2621 | 240 | public static function getTableName() { |
e501603b TO |
241 | return self::$_tableName; |
242 | } | |
c3fc2621 | 243 | |
e501603b TO |
244 | /** |
245 | * Returns if this table needs to be logged | |
246 | * | |
c3fc2621 | 247 | * @return bool |
e501603b | 248 | */ |
c3fc2621 | 249 | public function getLog() { |
e501603b TO |
250 | return self::$_log; |
251 | } | |
c3fc2621 | 252 | |
e501603b TO |
253 | /** |
254 | * Returns the list of fields that can be imported | |
255 | * | |
256 | * @param bool $prefix | |
257 | * | |
258 | * @return array | |
259 | */ | |
c3fc2621 CW |
260 | public static function &import($prefix = FALSE) { |
261 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'loc_block', $prefix, []); | |
60808919 | 262 | return $r; |
e501603b | 263 | } |
c3fc2621 | 264 | |
e501603b TO |
265 | /** |
266 | * Returns the list of fields that can be exported | |
267 | * | |
268 | * @param bool $prefix | |
269 | * | |
270 | * @return array | |
271 | */ | |
c3fc2621 CW |
272 | public static function &export($prefix = FALSE) { |
273 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'loc_block', $prefix, []); | |
60808919 | 274 | return $r; |
e501603b | 275 | } |
c3fc2621 | 276 | |
e7a6b91a AS |
277 | /** |
278 | * Returns the list of indices | |
c3fc2621 CW |
279 | * |
280 | * @param bool $localize | |
281 | * | |
282 | * @return array | |
e7a6b91a AS |
283 | */ |
284 | public static function indices($localize = TRUE) { | |
c3fc2621 | 285 | $indices = []; |
e7a6b91a AS |
286 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
287 | } | |
c3fc2621 | 288 | |
e501603b | 289 | } |