5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/LocBlock.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:0da5161ce83d29bc7626c1a3b74b2950)
13 * Database access object for the LocBlock entity.
15 class CRM_Core_DAO_LocBlock
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '2.0';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_loc_block';
27 * Icon associated with this entity.
31 public static $_icon = 'fa-map-o';
34 * Should CiviCRM log any modifications to this table in the civicrm_log table.
38 public static $_log = TRUE;
90 public function __construct() {
91 $this->__table
= 'civicrm_loc_block';
92 parent
::__construct();
96 * Returns localized title of this entity.
99 * Whether to return the plural version of the title.
101 public static function getEntityTitle($plural = FALSE) {
102 return $plural ?
ts('Locations') : ts('Location');
106 * Returns foreign keys and entity references.
109 * [CRM_Core_Reference_Interface]
111 public static function getReferenceColumns() {
112 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
113 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
114 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'address_id', 'civicrm_address', 'id');
115 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'email_id', 'civicrm_email', 'id');
116 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'phone_id', 'civicrm_phone', 'id');
117 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'im_id', 'civicrm_im', 'id');
118 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'address_2_id', 'civicrm_address', 'id');
119 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'email_2_id', 'civicrm_email', 'id');
120 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'phone_2_id', 'civicrm_phone', 'id');
121 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'im_2_id', 'civicrm_im', 'id');
122 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
124 return Civi
::$statics[__CLASS__
]['links'];
128 * Returns all the column names of this table
132 public static function &fields() {
133 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
134 Civi
::$statics[__CLASS__
]['fields'] = [
137 'type' => CRM_Utils_Type
::T_INT
,
138 'title' => ts('Location Block ID'),
139 'description' => ts('Unique ID'),
141 'where' => 'civicrm_loc_block.id',
142 'table_name' => 'civicrm_loc_block',
143 'entity' => 'LocBlock',
144 'bao' => 'CRM_Core_DAO_LocBlock',
153 'name' => 'address_id',
154 'type' => CRM_Utils_Type
::T_INT
,
155 'title' => ts('Address ID'),
156 'where' => 'civicrm_loc_block.address_id',
157 'table_name' => 'civicrm_loc_block',
158 'entity' => 'LocBlock',
159 'bao' => 'CRM_Core_DAO_LocBlock',
161 'FKClassName' => 'CRM_Core_DAO_Address',
163 'label' => ts("Address"),
168 'name' => 'email_id',
169 'type' => CRM_Utils_Type
::T_INT
,
170 'title' => ts('Email ID'),
171 'where' => 'civicrm_loc_block.email_id',
172 'table_name' => 'civicrm_loc_block',
173 'entity' => 'LocBlock',
174 'bao' => 'CRM_Core_DAO_LocBlock',
176 'FKClassName' => 'CRM_Core_DAO_Email',
178 'label' => ts("Email"),
183 'name' => 'phone_id',
184 'type' => CRM_Utils_Type
::T_INT
,
185 'title' => ts('Phone ID'),
186 'where' => 'civicrm_loc_block.phone_id',
187 'table_name' => 'civicrm_loc_block',
188 'entity' => 'LocBlock',
189 'bao' => 'CRM_Core_DAO_LocBlock',
191 'FKClassName' => 'CRM_Core_DAO_Phone',
193 'label' => ts("Phone"),
199 'type' => CRM_Utils_Type
::T_INT
,
200 'title' => ts('IM ID'),
201 'where' => 'civicrm_loc_block.im_id',
202 'table_name' => 'civicrm_loc_block',
203 'entity' => 'LocBlock',
204 'bao' => 'CRM_Core_DAO_LocBlock',
206 'FKClassName' => 'CRM_Core_DAO_IM',
208 'label' => ts("Instant Messenger"),
213 'name' => 'address_2_id',
214 'type' => CRM_Utils_Type
::T_INT
,
215 'title' => ts('Address 2 ID'),
216 'where' => 'civicrm_loc_block.address_2_id',
217 'table_name' => 'civicrm_loc_block',
218 'entity' => 'LocBlock',
219 'bao' => 'CRM_Core_DAO_LocBlock',
221 'FKClassName' => 'CRM_Core_DAO_Address',
223 'label' => ts("Address 2"),
228 'name' => 'email_2_id',
229 'type' => CRM_Utils_Type
::T_INT
,
230 'title' => ts('Email 2 ID'),
231 'where' => 'civicrm_loc_block.email_2_id',
232 'table_name' => 'civicrm_loc_block',
233 'entity' => 'LocBlock',
234 'bao' => 'CRM_Core_DAO_LocBlock',
236 'FKClassName' => 'CRM_Core_DAO_Email',
238 'label' => ts("Email 2"),
243 'name' => 'phone_2_id',
244 'type' => CRM_Utils_Type
::T_INT
,
245 'title' => ts('Phone 2 ID'),
246 'where' => 'civicrm_loc_block.phone_2_id',
247 'table_name' => 'civicrm_loc_block',
248 'entity' => 'LocBlock',
249 'bao' => 'CRM_Core_DAO_LocBlock',
251 'FKClassName' => 'CRM_Core_DAO_Phone',
253 'label' => ts("Phone 2"),
259 'type' => CRM_Utils_Type
::T_INT
,
260 'title' => ts('IM 2 ID'),
261 'where' => 'civicrm_loc_block.im_2_id',
262 'table_name' => 'civicrm_loc_block',
263 'entity' => 'LocBlock',
264 'bao' => 'CRM_Core_DAO_LocBlock',
266 'FKClassName' => 'CRM_Core_DAO_IM',
268 'label' => ts("Instant Messenger 2"),
273 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
275 return Civi
::$statics[__CLASS__
]['fields'];
279 * Return a mapping from field-name to the corresponding key (as used in fields()).
282 * Array(string $name => string $uniqueName).
284 public static function &fieldKeys() {
285 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
286 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
288 return Civi
::$statics[__CLASS__
]['fieldKeys'];
292 * Returns the names of this table
296 public static function getTableName() {
297 return self
::$_tableName;
301 * Returns if this table needs to be logged
305 public function getLog() {
310 * Returns the list of fields that can be imported
312 * @param bool $prefix
316 public static function &import($prefix = FALSE) {
317 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'loc_block', $prefix, []);
322 * Returns the list of fields that can be exported
324 * @param bool $prefix
328 public static function &export($prefix = FALSE) {
329 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'loc_block', $prefix, []);
334 * Returns the list of indices
336 * @param bool $localize
340 public static function indices($localize = TRUE) {
342 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;