Merge pull request #8916 from cividesk/CRM-19256-4.7
[civicrm-core.git] / CRM / Core / DAO / LocBlock.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2017
30 *
31 * Generated from xml/schema/CRM/Core/LocBlock.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:3b7c983be2e2ecc28d15c6ae02681985)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Core_DAO_LocBlock constructor.
39 */
40 class CRM_Core_DAO_LocBlock extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_loc_block';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
49 *
50 * @var boolean
51 */
52 static $_log = true;
53 /**
54 * Unique ID
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 *
61 * @var int unsigned
62 */
63 public $address_id;
64 /**
65 *
66 * @var int unsigned
67 */
68 public $email_id;
69 /**
70 *
71 * @var int unsigned
72 */
73 public $phone_id;
74 /**
75 *
76 * @var int unsigned
77 */
78 public $im_id;
79 /**
80 *
81 * @var int unsigned
82 */
83 public $address_2_id;
84 /**
85 *
86 * @var int unsigned
87 */
88 public $email_2_id;
89 /**
90 *
91 * @var int unsigned
92 */
93 public $phone_2_id;
94 /**
95 *
96 * @var int unsigned
97 */
98 public $im_2_id;
99 /**
100 * Class constructor.
101 */
102 function __construct() {
103 $this->__table = 'civicrm_loc_block';
104 parent::__construct();
105 }
106 /**
107 * Returns foreign keys and entity references.
108 *
109 * @return array
110 * [CRM_Core_Reference_Interface]
111 */
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']);
124 }
125 return Civi::$statics[__CLASS__]['links'];
126 }
127 /**
128 * Returns all the column names of this table
129 *
130 * @return array
131 */
132 static function &fields() {
133 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
134 Civi::$statics[__CLASS__]['fields'] = array(
135 'id' => array(
136 'name' => 'id',
137 'type' => CRM_Utils_Type::T_INT,
138 'title' => ts('Location Block ID') ,
139 'description' => 'Unique ID',
140 'required' => true,
141 ) ,
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',
147 ) ,
148 'email_id' => array(
149 'name' => 'email_id',
150 'type' => CRM_Utils_Type::T_INT,
151 'title' => ts('Location Block Email') ,
152 'FKClassName' => 'CRM_Core_DAO_Email',
153 ) ,
154 'phone_id' => array(
155 'name' => 'phone_id',
156 'type' => CRM_Utils_Type::T_INT,
157 'title' => ts('Location Block Phone') ,
158 'FKClassName' => 'CRM_Core_DAO_Phone',
159 ) ,
160 'im_id' => array(
161 'name' => 'im_id',
162 'type' => CRM_Utils_Type::T_INT,
163 'title' => ts('Location Block IM') ,
164 'FKClassName' => 'CRM_Core_DAO_IM',
165 ) ,
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',
171 ) ,
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',
177 ) ,
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',
183 ) ,
184 'im_2_id' => array(
185 'name' => 'im_2_id',
186 'type' => CRM_Utils_Type::T_INT,
187 'title' => ts('Instant Messenger 2') ,
188 'FKClassName' => 'CRM_Core_DAO_IM',
189 ) ,
190 );
191 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
192 }
193 return Civi::$statics[__CLASS__]['fields'];
194 }
195 /**
196 * Return a mapping from field-name to the corresponding key (as used in fields()).
197 *
198 * @return array
199 * Array(string $name => string $uniqueName).
200 */
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()));
204 }
205 return Civi::$statics[__CLASS__]['fieldKeys'];
206 }
207 /**
208 * Returns the names of this table
209 *
210 * @return string
211 */
212 static function getTableName() {
213 return self::$_tableName;
214 }
215 /**
216 * Returns if this table needs to be logged
217 *
218 * @return boolean
219 */
220 function getLog() {
221 return self::$_log;
222 }
223 /**
224 * Returns the list of fields that can be imported
225 *
226 * @param bool $prefix
227 *
228 * @return array
229 */
230 static function &import($prefix = false) {
231 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'loc_block', $prefix, array());
232 return $r;
233 }
234 /**
235 * Returns the list of fields that can be exported
236 *
237 * @param bool $prefix
238 *
239 * @return array
240 */
241 static function &export($prefix = false) {
242 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'loc_block', $prefix, array());
243 return $r;
244 }
245 }