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:8459c5a6d25e5c70e44de49b109a82fa)
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 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
83 public function __construct() {
84 $this->__table
= 'civicrm_loc_block';
85 parent
::__construct();
89 * Returns localized title of this entity.
91 public static function getEntityTitle() {
92 return ts('Loc Blocks');
96 * Returns foreign keys and entity references.
99 * [CRM_Core_Reference_Interface]
101 public static function getReferenceColumns() {
102 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
103 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
104 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'address_id', 'civicrm_address', 'id');
105 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'email_id', 'civicrm_email', 'id');
106 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'phone_id', 'civicrm_phone', 'id');
107 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'im_id', 'civicrm_im', 'id');
108 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'address_2_id', 'civicrm_address', 'id');
109 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'email_2_id', 'civicrm_email', 'id');
110 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'phone_2_id', 'civicrm_phone', 'id');
111 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'im_2_id', 'civicrm_im', 'id');
112 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
114 return Civi
::$statics[__CLASS__
]['links'];
118 * Returns all the column names of this table
122 public static function &fields() {
123 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
124 Civi
::$statics[__CLASS__
]['fields'] = [
127 'type' => CRM_Utils_Type
::T_INT
,
128 'title' => ts('Location Block ID'),
129 'description' => ts('Unique ID'),
131 'where' => 'civicrm_loc_block.id',
132 'table_name' => 'civicrm_loc_block',
133 'entity' => 'LocBlock',
134 'bao' => 'CRM_Core_DAO_LocBlock',
139 'name' => 'address_id',
140 'type' => CRM_Utils_Type
::T_INT
,
141 'title' => ts('Location Block Address'),
142 'where' => 'civicrm_loc_block.address_id',
143 'table_name' => 'civicrm_loc_block',
144 'entity' => 'LocBlock',
145 'bao' => 'CRM_Core_DAO_LocBlock',
147 'FKClassName' => 'CRM_Core_DAO_Address',
151 'name' => 'email_id',
152 'type' => CRM_Utils_Type
::T_INT
,
153 'title' => ts('Location Block Email'),
154 'where' => 'civicrm_loc_block.email_id',
155 'table_name' => 'civicrm_loc_block',
156 'entity' => 'LocBlock',
157 'bao' => 'CRM_Core_DAO_LocBlock',
159 'FKClassName' => 'CRM_Core_DAO_Email',
163 'name' => 'phone_id',
164 'type' => CRM_Utils_Type
::T_INT
,
165 'title' => ts('Location Block Phone'),
166 'where' => 'civicrm_loc_block.phone_id',
167 'table_name' => 'civicrm_loc_block',
168 'entity' => 'LocBlock',
169 'bao' => 'CRM_Core_DAO_LocBlock',
171 'FKClassName' => 'CRM_Core_DAO_Phone',
176 'type' => CRM_Utils_Type
::T_INT
,
177 'title' => ts('Location Block IM'),
178 'where' => 'civicrm_loc_block.im_id',
179 'table_name' => 'civicrm_loc_block',
180 'entity' => 'LocBlock',
181 'bao' => 'CRM_Core_DAO_LocBlock',
183 'FKClassName' => 'CRM_Core_DAO_IM',
187 'name' => 'address_2_id',
188 'type' => CRM_Utils_Type
::T_INT
,
189 'title' => ts('Location Block IM 2'),
190 'where' => 'civicrm_loc_block.address_2_id',
191 'table_name' => 'civicrm_loc_block',
192 'entity' => 'LocBlock',
193 'bao' => 'CRM_Core_DAO_LocBlock',
195 'FKClassName' => 'CRM_Core_DAO_Address',
199 'name' => 'email_2_id',
200 'type' => CRM_Utils_Type
::T_INT
,
201 'title' => ts('Email 2'),
202 'where' => 'civicrm_loc_block.email_2_id',
203 'table_name' => 'civicrm_loc_block',
204 'entity' => 'LocBlock',
205 'bao' => 'CRM_Core_DAO_LocBlock',
207 'FKClassName' => 'CRM_Core_DAO_Email',
211 'name' => 'phone_2_id',
212 'type' => CRM_Utils_Type
::T_INT
,
213 'title' => ts('Phone 2'),
214 'where' => 'civicrm_loc_block.phone_2_id',
215 'table_name' => 'civicrm_loc_block',
216 'entity' => 'LocBlock',
217 'bao' => 'CRM_Core_DAO_LocBlock',
219 'FKClassName' => 'CRM_Core_DAO_Phone',
224 'type' => CRM_Utils_Type
::T_INT
,
225 'title' => ts('Instant Messenger 2'),
226 'where' => 'civicrm_loc_block.im_2_id',
227 'table_name' => 'civicrm_loc_block',
228 'entity' => 'LocBlock',
229 'bao' => 'CRM_Core_DAO_LocBlock',
231 'FKClassName' => 'CRM_Core_DAO_IM',
235 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
237 return Civi
::$statics[__CLASS__
]['fields'];
241 * Return a mapping from field-name to the corresponding key (as used in fields()).
244 * Array(string $name => string $uniqueName).
246 public static function &fieldKeys() {
247 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
248 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
250 return Civi
::$statics[__CLASS__
]['fieldKeys'];
254 * Returns the names of this table
258 public static function getTableName() {
259 return self
::$_tableName;
263 * Returns if this table needs to be logged
267 public function getLog() {
272 * Returns the list of fields that can be imported
274 * @param bool $prefix
278 public static function &import($prefix = FALSE) {
279 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'loc_block', $prefix, []);
284 * Returns the list of fields that can be exported
286 * @param bool $prefix
290 public static function &export($prefix = FALSE) {
291 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'loc_block', $prefix, []);
296 * Returns the list of indices
298 * @param bool $localize
302 public static function indices($localize = TRUE) {
304 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;