5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/LocBlock.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:f2893cf360fe552d5ff1d90e2eb9272c)
13 * Database access object for the LocBlock entity.
15 class CRM_Core_DAO_LocBlock
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_loc_block';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
81 public function __construct() {
82 $this->__table
= 'civicrm_loc_block';
83 parent
::__construct();
87 * Returns foreign keys and entity references.
90 * [CRM_Core_Reference_Interface]
92 public static function getReferenceColumns() {
93 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
94 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
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');
103 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
105 return Civi
::$statics[__CLASS__
]['links'];
109 * Returns all the column names of this table
113 public static function &fields() {
114 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
115 Civi
::$statics[__CLASS__
]['fields'] = [
118 'type' => CRM_Utils_Type
::T_INT
,
119 'title' => ts('Location Block ID'),
120 'description' => ts('Unique ID'),
122 'where' => 'civicrm_loc_block.id',
123 'table_name' => 'civicrm_loc_block',
124 'entity' => 'LocBlock',
125 'bao' => 'CRM_Core_DAO_LocBlock',
129 'name' => 'address_id',
130 'type' => CRM_Utils_Type
::T_INT
,
131 'title' => ts('Location Block Address'),
132 'where' => 'civicrm_loc_block.address_id',
133 'table_name' => 'civicrm_loc_block',
134 'entity' => 'LocBlock',
135 'bao' => 'CRM_Core_DAO_LocBlock',
137 'FKClassName' => 'CRM_Core_DAO_Address',
140 'name' => 'email_id',
141 'type' => CRM_Utils_Type
::T_INT
,
142 'title' => ts('Location Block Email'),
143 'where' => 'civicrm_loc_block.email_id',
144 'table_name' => 'civicrm_loc_block',
145 'entity' => 'LocBlock',
146 'bao' => 'CRM_Core_DAO_LocBlock',
148 'FKClassName' => 'CRM_Core_DAO_Email',
151 'name' => 'phone_id',
152 'type' => CRM_Utils_Type
::T_INT
,
153 'title' => ts('Location Block Phone'),
154 'where' => 'civicrm_loc_block.phone_id',
155 'table_name' => 'civicrm_loc_block',
156 'entity' => 'LocBlock',
157 'bao' => 'CRM_Core_DAO_LocBlock',
159 'FKClassName' => 'CRM_Core_DAO_Phone',
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('Location Block IM'),
165 'where' => 'civicrm_loc_block.im_id',
166 'table_name' => 'civicrm_loc_block',
167 'entity' => 'LocBlock',
168 'bao' => 'CRM_Core_DAO_LocBlock',
170 'FKClassName' => 'CRM_Core_DAO_IM',
173 'name' => 'address_2_id',
174 'type' => CRM_Utils_Type
::T_INT
,
175 'title' => ts('Location Block IM 2'),
176 'where' => 'civicrm_loc_block.address_2_id',
177 'table_name' => 'civicrm_loc_block',
178 'entity' => 'LocBlock',
179 'bao' => 'CRM_Core_DAO_LocBlock',
181 'FKClassName' => 'CRM_Core_DAO_Address',
184 'name' => 'email_2_id',
185 'type' => CRM_Utils_Type
::T_INT
,
186 'title' => ts('Email 2'),
187 'where' => 'civicrm_loc_block.email_2_id',
188 'table_name' => 'civicrm_loc_block',
189 'entity' => 'LocBlock',
190 'bao' => 'CRM_Core_DAO_LocBlock',
192 'FKClassName' => 'CRM_Core_DAO_Email',
195 'name' => 'phone_2_id',
196 'type' => CRM_Utils_Type
::T_INT
,
197 'title' => ts('Phone 2'),
198 'where' => 'civicrm_loc_block.phone_2_id',
199 'table_name' => 'civicrm_loc_block',
200 'entity' => 'LocBlock',
201 'bao' => 'CRM_Core_DAO_LocBlock',
203 'FKClassName' => 'CRM_Core_DAO_Phone',
207 'type' => CRM_Utils_Type
::T_INT
,
208 'title' => ts('Instant Messenger 2'),
209 'where' => 'civicrm_loc_block.im_2_id',
210 'table_name' => 'civicrm_loc_block',
211 'entity' => 'LocBlock',
212 'bao' => 'CRM_Core_DAO_LocBlock',
214 'FKClassName' => 'CRM_Core_DAO_IM',
217 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
219 return Civi
::$statics[__CLASS__
]['fields'];
223 * Return a mapping from field-name to the corresponding key (as used in fields()).
226 * Array(string $name => string $uniqueName).
228 public static function &fieldKeys() {
229 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
230 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
232 return Civi
::$statics[__CLASS__
]['fieldKeys'];
236 * Returns the names of this table
240 public static function getTableName() {
241 return self
::$_tableName;
245 * Returns if this table needs to be logged
249 public function getLog() {
254 * Returns the list of fields that can be imported
256 * @param bool $prefix
260 public static function &import($prefix = FALSE) {
261 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'loc_block', $prefix, []);
266 * Returns the list of fields that can be exported
268 * @param bool $prefix
272 public static function &export($prefix = FALSE) {
273 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'loc_block', $prefix, []);
278 * Returns the list of indices
280 * @param bool $localize
284 public static function indices($localize = TRUE) {
286 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;