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:cc12c8f1ddd73d6d8b1d056dd04696e9)
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 static $_tableName = 'civicrm_loc_block';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 'table_name' => 'civicrm_loc_block',
123 'entity' => 'LocBlock',
124 'bao' => 'CRM_Core_DAO_LocBlock',
128 'name' => 'address_id',
129 'type' => CRM_Utils_Type
::T_INT
,
130 'title' => ts('Location Block Address'),
131 'table_name' => 'civicrm_loc_block',
132 'entity' => 'LocBlock',
133 'bao' => 'CRM_Core_DAO_LocBlock',
135 'FKClassName' => 'CRM_Core_DAO_Address',
138 'name' => 'email_id',
139 'type' => CRM_Utils_Type
::T_INT
,
140 'title' => ts('Location Block Email'),
141 'table_name' => 'civicrm_loc_block',
142 'entity' => 'LocBlock',
143 'bao' => 'CRM_Core_DAO_LocBlock',
145 'FKClassName' => 'CRM_Core_DAO_Email',
148 'name' => 'phone_id',
149 'type' => CRM_Utils_Type
::T_INT
,
150 'title' => ts('Location Block Phone'),
151 'table_name' => 'civicrm_loc_block',
152 'entity' => 'LocBlock',
153 'bao' => 'CRM_Core_DAO_LocBlock',
155 'FKClassName' => 'CRM_Core_DAO_Phone',
159 'type' => CRM_Utils_Type
::T_INT
,
160 'title' => ts('Location Block IM'),
161 'table_name' => 'civicrm_loc_block',
162 'entity' => 'LocBlock',
163 'bao' => 'CRM_Core_DAO_LocBlock',
165 'FKClassName' => 'CRM_Core_DAO_IM',
168 'name' => 'address_2_id',
169 'type' => CRM_Utils_Type
::T_INT
,
170 'title' => ts('Location Block IM 2'),
171 'table_name' => 'civicrm_loc_block',
172 'entity' => 'LocBlock',
173 'bao' => 'CRM_Core_DAO_LocBlock',
175 'FKClassName' => 'CRM_Core_DAO_Address',
178 'name' => 'email_2_id',
179 'type' => CRM_Utils_Type
::T_INT
,
180 'title' => ts('Email 2'),
181 'table_name' => 'civicrm_loc_block',
182 'entity' => 'LocBlock',
183 'bao' => 'CRM_Core_DAO_LocBlock',
185 'FKClassName' => 'CRM_Core_DAO_Email',
188 'name' => 'phone_2_id',
189 'type' => CRM_Utils_Type
::T_INT
,
190 'title' => ts('Phone 2'),
191 'table_name' => 'civicrm_loc_block',
192 'entity' => 'LocBlock',
193 'bao' => 'CRM_Core_DAO_LocBlock',
195 'FKClassName' => 'CRM_Core_DAO_Phone',
199 'type' => CRM_Utils_Type
::T_INT
,
200 'title' => ts('Instant Messenger 2'),
201 'table_name' => 'civicrm_loc_block',
202 'entity' => 'LocBlock',
203 'bao' => 'CRM_Core_DAO_LocBlock',
205 'FKClassName' => 'CRM_Core_DAO_IM',
208 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
210 return Civi
::$statics[__CLASS__
]['fields'];
214 * Return a mapping from field-name to the corresponding key (as used in fields()).
217 * Array(string $name => string $uniqueName).
219 public static function &fieldKeys() {
220 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
221 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
223 return Civi
::$statics[__CLASS__
]['fieldKeys'];
227 * Returns the names of this table
231 public static function getTableName() {
232 return self
::$_tableName;
236 * Returns if this table needs to be logged
240 public function getLog() {
245 * Returns the list of fields that can be imported
247 * @param bool $prefix
251 public static function &import($prefix = FALSE) {
252 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'loc_block', $prefix, []);
257 * Returns the list of fields that can be exported
259 * @param bool $prefix
263 public static function &export($prefix = FALSE) {
264 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'loc_block', $prefix, []);
269 * Returns the list of indices
271 * @param bool $localize
275 public static function indices($localize = TRUE) {
277 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;