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:3b7c983be2e2ecc28d15c6ae02681985)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_LocBlock
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_loc_block';
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
100 * @return civicrm_loc_block
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',
142 'address_id' => array(
143 'name' => 'address_id',
144 'type' => CRM_Utils_Type
::T_INT
,
145 'title' => ts('Location Block Address') ,
146 'FKClassName' => 'CRM_Core_DAO_Address',
149 'name' => 'email_id',
150 'type' => CRM_Utils_Type
::T_INT
,
151 'title' => ts('Location Block Email') ,
152 'FKClassName' => 'CRM_Core_DAO_Email',
155 'name' => 'phone_id',
156 'type' => CRM_Utils_Type
::T_INT
,
157 'title' => ts('Location Block Phone') ,
158 'FKClassName' => 'CRM_Core_DAO_Phone',
162 'type' => CRM_Utils_Type
::T_INT
,
163 'title' => ts('Location Block IM') ,
164 'FKClassName' => 'CRM_Core_DAO_IM',
166 'address_2_id' => array(
167 'name' => 'address_2_id',
168 'type' => CRM_Utils_Type
::T_INT
,
169 'title' => ts('Location Block IM 2') ,
170 'FKClassName' => 'CRM_Core_DAO_Address',
172 'email_2_id' => array(
173 'name' => 'email_2_id',
174 'type' => CRM_Utils_Type
::T_INT
,
175 'title' => ts('Email 2') ,
176 'FKClassName' => 'CRM_Core_DAO_Email',
178 'phone_2_id' => array(
179 'name' => 'phone_2_id',
180 'type' => CRM_Utils_Type
::T_INT
,
181 'title' => ts('Phone 2') ,
182 'FKClassName' => 'CRM_Core_DAO_Phone',
186 'type' => CRM_Utils_Type
::T_INT
,
187 'title' => ts('Instant Messenger 2') ,
188 'FKClassName' => 'CRM_Core_DAO_IM',
191 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
193 return Civi
::$statics[__CLASS__
]['fields'];
196 * Return a mapping from field-name to the corresponding key (as used in fields()).
199 * Array(string $name => string $uniqueName).
201 static function &fieldKeys() {
202 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
203 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
205 return Civi
::$statics[__CLASS__
]['fieldKeys'];
208 * Returns the names of this table
212 static function getTableName() {
213 return self
::$_tableName;
216 * Returns if this table needs to be logged
224 * Returns the list of fields that can be imported
226 * @param bool $prefix
230 static function &import($prefix = false) {
231 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'loc_block', $prefix, array());
235 * Returns the list of fields that can be exported
237 * @param bool $prefix
241 static function &export($prefix = false) {
242 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'loc_block', $prefix, array());