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:fd6b47fdf91519058cc607ab736a8934)
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 localized title of this entity.
89 public static function getEntityTitle() {
90 return ts('Loc Blocks');
94 * Returns foreign keys and entity references.
97 * [CRM_Core_Reference_Interface]
99 public static function getReferenceColumns() {
100 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
101 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
102 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'address_id', 'civicrm_address', 'id');
103 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'email_id', 'civicrm_email', 'id');
104 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'phone_id', 'civicrm_phone', 'id');
105 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'im_id', 'civicrm_im', 'id');
106 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'address_2_id', 'civicrm_address', 'id');
107 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'email_2_id', 'civicrm_email', 'id');
108 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'phone_2_id', 'civicrm_phone', 'id');
109 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'im_2_id', 'civicrm_im', 'id');
110 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
112 return Civi
::$statics[__CLASS__
]['links'];
116 * Returns all the column names of this table
120 public static function &fields() {
121 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
122 Civi
::$statics[__CLASS__
]['fields'] = [
125 'type' => CRM_Utils_Type
::T_INT
,
126 'title' => ts('Location Block ID'),
127 'description' => ts('Unique ID'),
129 'where' => 'civicrm_loc_block.id',
130 'table_name' => 'civicrm_loc_block',
131 'entity' => 'LocBlock',
132 'bao' => 'CRM_Core_DAO_LocBlock',
137 'name' => 'address_id',
138 'type' => CRM_Utils_Type
::T_INT
,
139 'title' => ts('Location Block Address'),
140 'where' => 'civicrm_loc_block.address_id',
141 'table_name' => 'civicrm_loc_block',
142 'entity' => 'LocBlock',
143 'bao' => 'CRM_Core_DAO_LocBlock',
145 'FKClassName' => 'CRM_Core_DAO_Address',
149 'name' => 'email_id',
150 'type' => CRM_Utils_Type
::T_INT
,
151 'title' => ts('Location Block Email'),
152 'where' => 'civicrm_loc_block.email_id',
153 'table_name' => 'civicrm_loc_block',
154 'entity' => 'LocBlock',
155 'bao' => 'CRM_Core_DAO_LocBlock',
157 'FKClassName' => 'CRM_Core_DAO_Email',
161 'name' => 'phone_id',
162 'type' => CRM_Utils_Type
::T_INT
,
163 'title' => ts('Location Block Phone'),
164 'where' => 'civicrm_loc_block.phone_id',
165 'table_name' => 'civicrm_loc_block',
166 'entity' => 'LocBlock',
167 'bao' => 'CRM_Core_DAO_LocBlock',
169 'FKClassName' => 'CRM_Core_DAO_Phone',
174 'type' => CRM_Utils_Type
::T_INT
,
175 'title' => ts('Location Block IM'),
176 'where' => 'civicrm_loc_block.im_id',
177 'table_name' => 'civicrm_loc_block',
178 'entity' => 'LocBlock',
179 'bao' => 'CRM_Core_DAO_LocBlock',
181 'FKClassName' => 'CRM_Core_DAO_IM',
185 'name' => 'address_2_id',
186 'type' => CRM_Utils_Type
::T_INT
,
187 'title' => ts('Location Block IM 2'),
188 'where' => 'civicrm_loc_block.address_2_id',
189 'table_name' => 'civicrm_loc_block',
190 'entity' => 'LocBlock',
191 'bao' => 'CRM_Core_DAO_LocBlock',
193 'FKClassName' => 'CRM_Core_DAO_Address',
197 'name' => 'email_2_id',
198 'type' => CRM_Utils_Type
::T_INT
,
199 'title' => ts('Email 2'),
200 'where' => 'civicrm_loc_block.email_2_id',
201 'table_name' => 'civicrm_loc_block',
202 'entity' => 'LocBlock',
203 'bao' => 'CRM_Core_DAO_LocBlock',
205 'FKClassName' => 'CRM_Core_DAO_Email',
209 'name' => 'phone_2_id',
210 'type' => CRM_Utils_Type
::T_INT
,
211 'title' => ts('Phone 2'),
212 'where' => 'civicrm_loc_block.phone_2_id',
213 'table_name' => 'civicrm_loc_block',
214 'entity' => 'LocBlock',
215 'bao' => 'CRM_Core_DAO_LocBlock',
217 'FKClassName' => 'CRM_Core_DAO_Phone',
222 'type' => CRM_Utils_Type
::T_INT
,
223 'title' => ts('Instant Messenger 2'),
224 'where' => 'civicrm_loc_block.im_2_id',
225 'table_name' => 'civicrm_loc_block',
226 'entity' => 'LocBlock',
227 'bao' => 'CRM_Core_DAO_LocBlock',
229 'FKClassName' => 'CRM_Core_DAO_IM',
233 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
235 return Civi
::$statics[__CLASS__
]['fields'];
239 * Return a mapping from field-name to the corresponding key (as used in fields()).
242 * Array(string $name => string $uniqueName).
244 public static function &fieldKeys() {
245 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
246 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
248 return Civi
::$statics[__CLASS__
]['fieldKeys'];
252 * Returns the names of this table
256 public static function getTableName() {
257 return self
::$_tableName;
261 * Returns if this table needs to be logged
265 public function getLog() {
270 * Returns the list of fields that can be imported
272 * @param bool $prefix
276 public static function &import($prefix = FALSE) {
277 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'loc_block', $prefix, []);
282 * Returns the list of fields that can be exported
284 * @param bool $prefix
288 public static function &export($prefix = FALSE) {
289 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'loc_block', $prefix, []);
294 * Returns the list of indices
296 * @param bool $localize
300 public static function indices($localize = TRUE) {
302 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;