3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Core/LocBlock.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:0782115dac3b6bb5e8a0291ddf5285ba)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_LocBlock constructor.
40 class CRM_Core_DAO_LocBlock
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_loc_block';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
102 function __construct() {
103 $this->__table
= 'civicrm_loc_block';
104 parent
::__construct();
107 * Returns foreign keys and entity references.
110 * [CRM_Core_Reference_Interface]
112 static function getReferenceColumns() {
113 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
114 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
115 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'address_id', 'civicrm_address', 'id');
116 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'email_id', 'civicrm_email', 'id');
117 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'phone_id', 'civicrm_phone', 'id');
118 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'im_id', 'civicrm_im', 'id');
119 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'address_2_id', 'civicrm_address', 'id');
120 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'email_2_id', 'civicrm_email', 'id');
121 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'phone_2_id', 'civicrm_phone', 'id');
122 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'im_2_id', 'civicrm_im', 'id');
123 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
125 return Civi
::$statics[__CLASS__
]['links'];
128 * Returns all the column names of this table
132 static function &fields() {
133 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
134 Civi
::$statics[__CLASS__
]['fields'] = array(
137 'type' => CRM_Utils_Type
::T_INT
,
138 'title' => ts('Location Block ID') ,
139 'description' => 'Unique ID',
141 'table_name' => 'civicrm_loc_block',
142 'entity' => 'LocBlock',
143 'bao' => 'CRM_Core_DAO_LocBlock',
146 'address_id' => array(
147 'name' => 'address_id',
148 'type' => CRM_Utils_Type
::T_INT
,
149 'title' => ts('Location Block Address') ,
150 'table_name' => 'civicrm_loc_block',
151 'entity' => 'LocBlock',
152 'bao' => 'CRM_Core_DAO_LocBlock',
154 'FKClassName' => 'CRM_Core_DAO_Address',
157 'name' => 'email_id',
158 'type' => CRM_Utils_Type
::T_INT
,
159 'title' => ts('Location Block Email') ,
160 'table_name' => 'civicrm_loc_block',
161 'entity' => 'LocBlock',
162 'bao' => 'CRM_Core_DAO_LocBlock',
164 'FKClassName' => 'CRM_Core_DAO_Email',
167 'name' => 'phone_id',
168 'type' => CRM_Utils_Type
::T_INT
,
169 'title' => ts('Location Block Phone') ,
170 'table_name' => 'civicrm_loc_block',
171 'entity' => 'LocBlock',
172 'bao' => 'CRM_Core_DAO_LocBlock',
174 'FKClassName' => 'CRM_Core_DAO_Phone',
178 'type' => CRM_Utils_Type
::T_INT
,
179 'title' => ts('Location Block IM') ,
180 'table_name' => 'civicrm_loc_block',
181 'entity' => 'LocBlock',
182 'bao' => 'CRM_Core_DAO_LocBlock',
184 'FKClassName' => 'CRM_Core_DAO_IM',
186 'address_2_id' => array(
187 'name' => 'address_2_id',
188 'type' => CRM_Utils_Type
::T_INT
,
189 'title' => ts('Location Block IM 2') ,
190 'table_name' => 'civicrm_loc_block',
191 'entity' => 'LocBlock',
192 'bao' => 'CRM_Core_DAO_LocBlock',
194 'FKClassName' => 'CRM_Core_DAO_Address',
196 'email_2_id' => array(
197 'name' => 'email_2_id',
198 'type' => CRM_Utils_Type
::T_INT
,
199 'title' => ts('Email 2') ,
200 'table_name' => 'civicrm_loc_block',
201 'entity' => 'LocBlock',
202 'bao' => 'CRM_Core_DAO_LocBlock',
204 'FKClassName' => 'CRM_Core_DAO_Email',
206 'phone_2_id' => array(
207 'name' => 'phone_2_id',
208 'type' => CRM_Utils_Type
::T_INT
,
209 'title' => ts('Phone 2') ,
210 'table_name' => 'civicrm_loc_block',
211 'entity' => 'LocBlock',
212 'bao' => 'CRM_Core_DAO_LocBlock',
214 'FKClassName' => 'CRM_Core_DAO_Phone',
218 'type' => CRM_Utils_Type
::T_INT
,
219 'title' => ts('Instant Messenger 2') ,
220 'table_name' => 'civicrm_loc_block',
221 'entity' => 'LocBlock',
222 'bao' => 'CRM_Core_DAO_LocBlock',
224 'FKClassName' => 'CRM_Core_DAO_IM',
227 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
229 return Civi
::$statics[__CLASS__
]['fields'];
232 * Return a mapping from field-name to the corresponding key (as used in fields()).
235 * Array(string $name => string $uniqueName).
237 static function &fieldKeys() {
238 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
239 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
241 return Civi
::$statics[__CLASS__
]['fieldKeys'];
244 * Returns the names of this table
248 static function getTableName() {
249 return self
::$_tableName;
252 * Returns if this table needs to be logged
260 * Returns the list of fields that can be imported
262 * @param bool $prefix
266 static function &import($prefix = false) {
267 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'loc_block', $prefix, array());
271 * Returns the list of fields that can be exported
273 * @param bool $prefix
277 static function &export($prefix = false) {
278 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'loc_block', $prefix, array());
282 * Returns the list of indices
284 public static function indices($localize = TRUE) {
286 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;