CRM-20312 regenerated DAO with localisation
[civicrm-core.git] / CRM / Core / DAO / MappingField.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/MappingField.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:6e729c48a9732fd57132ddfe6f9d02b9)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Core_DAO_MappingField constructor.
39 */
40 class CRM_Core_DAO_MappingField extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_mapping_field';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 * Mapping Field ID
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * Mapping to which this field belongs
61 *
62 * @var int unsigned
63 */
64 public $mapping_id;
65 /**
66 * Mapping field key
67 *
68 * @var string
69 */
70 public $name;
71 /**
72 * Contact Type in mapping
73 *
74 * @var string
75 */
76 public $contact_type;
77 /**
78 * Column number for mapping set
79 *
80 * @var int unsigned
81 */
82 public $column_number;
83 /**
84 * Location type of this mapping, if required
85 *
86 * @var int unsigned
87 */
88 public $location_type_id;
89 /**
90 * Which type of phone does this number belongs.
91 *
92 * @var int unsigned
93 */
94 public $phone_type_id;
95 /**
96 * Which type of IM Provider does this name belong.
97 *
98 * @var int unsigned
99 */
100 public $im_provider_id;
101 /**
102 * Which type of website does this site belong
103 *
104 * @var int unsigned
105 */
106 public $website_type_id;
107 /**
108 * Relationship type, if required
109 *
110 * @var int unsigned
111 */
112 public $relationship_type_id;
113 /**
114 *
115 * @var string
116 */
117 public $relationship_direction;
118 /**
119 * Used to group mapping_field records into related sets (e.g. for criteria sets in search builder
120 mappings).
121 *
122 * @var int unsigned
123 */
124 public $grouping;
125 /**
126 * SQL WHERE operator for search-builder mapping fields (search criteria).
127 *
128 * @var string
129 */
130 public $operator;
131 /**
132 * SQL WHERE value for search-builder mapping fields.
133 *
134 * @var string
135 */
136 public $value;
137 /**
138 * Class constructor.
139 */
140 function __construct() {
141 $this->__table = 'civicrm_mapping_field';
142 parent::__construct();
143 }
144 /**
145 * Returns foreign keys and entity references.
146 *
147 * @return array
148 * [CRM_Core_Reference_Interface]
149 */
150 static function getReferenceColumns() {
151 if (!isset(Civi::$statics[__CLASS__]['links'])) {
152 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
153 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'mapping_id', 'civicrm_mapping', 'id');
154 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'location_type_id', 'civicrm_location_type', 'id');
155 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'relationship_type_id', 'civicrm_relationship_type', 'id');
156 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
157 }
158 return Civi::$statics[__CLASS__]['links'];
159 }
160 /**
161 * Returns all the column names of this table
162 *
163 * @return array
164 */
165 static function &fields() {
166 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
167 Civi::$statics[__CLASS__]['fields'] = array(
168 'id' => array(
169 'name' => 'id',
170 'type' => CRM_Utils_Type::T_INT,
171 'title' => ts('Mapping Field ID') ,
172 'description' => 'Mapping Field ID',
173 'required' => true,
174 'table_name' => 'civicrm_mapping_field',
175 'entity' => 'MappingField',
176 'bao' => 'CRM_Core_DAO_MappingField',
177 'localizable' => 0,
178 ) ,
179 'mapping_id' => array(
180 'name' => 'mapping_id',
181 'type' => CRM_Utils_Type::T_INT,
182 'title' => ts('Mapping ID') ,
183 'description' => 'Mapping to which this field belongs',
184 'required' => true,
185 'table_name' => 'civicrm_mapping_field',
186 'entity' => 'MappingField',
187 'bao' => 'CRM_Core_DAO_MappingField',
188 'localizable' => 0,
189 'FKClassName' => 'CRM_Core_DAO_Mapping',
190 ) ,
191 'name' => array(
192 'name' => 'name',
193 'type' => CRM_Utils_Type::T_STRING,
194 'title' => ts('Name') ,
195 'description' => 'Mapping field key',
196 'maxlength' => 255,
197 'size' => CRM_Utils_Type::HUGE,
198 'table_name' => 'civicrm_mapping_field',
199 'entity' => 'MappingField',
200 'bao' => 'CRM_Core_DAO_MappingField',
201 'localizable' => 0,
202 ) ,
203 'contact_type' => array(
204 'name' => 'contact_type',
205 'type' => CRM_Utils_Type::T_STRING,
206 'title' => ts('Contact Type') ,
207 'description' => 'Contact Type in mapping',
208 'maxlength' => 64,
209 'size' => CRM_Utils_Type::BIG,
210 'table_name' => 'civicrm_mapping_field',
211 'entity' => 'MappingField',
212 'bao' => 'CRM_Core_DAO_MappingField',
213 'localizable' => 0,
214 'html' => array(
215 'type' => 'Select',
216 ) ,
217 ) ,
218 'column_number' => array(
219 'name' => 'column_number',
220 'type' => CRM_Utils_Type::T_INT,
221 'title' => ts('Column Number') ,
222 'description' => 'Column number for mapping set',
223 'required' => true,
224 'table_name' => 'civicrm_mapping_field',
225 'entity' => 'MappingField',
226 'bao' => 'CRM_Core_DAO_MappingField',
227 'localizable' => 0,
228 ) ,
229 'location_type_id' => array(
230 'name' => 'location_type_id',
231 'type' => CRM_Utils_Type::T_INT,
232 'title' => ts('Location type ID') ,
233 'description' => 'Location type of this mapping, if required',
234 'table_name' => 'civicrm_mapping_field',
235 'entity' => 'MappingField',
236 'bao' => 'CRM_Core_DAO_MappingField',
237 'localizable' => 0,
238 'FKClassName' => 'CRM_Core_DAO_LocationType',
239 ) ,
240 'phone_type_id' => array(
241 'name' => 'phone_type_id',
242 'type' => CRM_Utils_Type::T_INT,
243 'title' => ts('Phone type ID') ,
244 'description' => 'Which type of phone does this number belongs.',
245 'table_name' => 'civicrm_mapping_field',
246 'entity' => 'MappingField',
247 'bao' => 'CRM_Core_DAO_MappingField',
248 'localizable' => 0,
249 ) ,
250 'im_provider_id' => array(
251 'name' => 'im_provider_id',
252 'type' => CRM_Utils_Type::T_INT,
253 'title' => ts('IM provider ID') ,
254 'description' => 'Which type of IM Provider does this name belong.',
255 'table_name' => 'civicrm_mapping_field',
256 'entity' => 'MappingField',
257 'bao' => 'CRM_Core_DAO_MappingField',
258 'localizable' => 0,
259 'html' => array(
260 'type' => 'Select',
261 ) ,
262 'pseudoconstant' => array(
263 'optionGroupName' => 'instant_messenger_service',
264 'optionEditPath' => 'civicrm/admin/options/instant_messenger_service',
265 )
266 ) ,
267 'website_type_id' => array(
268 'name' => 'website_type_id',
269 'type' => CRM_Utils_Type::T_INT,
270 'title' => ts('Website type ID') ,
271 'description' => 'Which type of website does this site belong',
272 'table_name' => 'civicrm_mapping_field',
273 'entity' => 'MappingField',
274 'bao' => 'CRM_Core_DAO_MappingField',
275 'localizable' => 0,
276 'html' => array(
277 'type' => 'Select',
278 ) ,
279 'pseudoconstant' => array(
280 'optionGroupName' => 'website_type',
281 'optionEditPath' => 'civicrm/admin/options/website_type',
282 )
283 ) ,
284 'relationship_type_id' => array(
285 'name' => 'relationship_type_id',
286 'type' => CRM_Utils_Type::T_INT,
287 'title' => ts('Relationship type ID') ,
288 'description' => 'Relationship type, if required',
289 'table_name' => 'civicrm_mapping_field',
290 'entity' => 'MappingField',
291 'bao' => 'CRM_Core_DAO_MappingField',
292 'localizable' => 0,
293 'FKClassName' => 'CRM_Contact_DAO_RelationshipType',
294 ) ,
295 'relationship_direction' => array(
296 'name' => 'relationship_direction',
297 'type' => CRM_Utils_Type::T_STRING,
298 'title' => ts('Relationship Direction') ,
299 'maxlength' => 6,
300 'size' => CRM_Utils_Type::SIX,
301 'table_name' => 'civicrm_mapping_field',
302 'entity' => 'MappingField',
303 'bao' => 'CRM_Core_DAO_MappingField',
304 'localizable' => 0,
305 ) ,
306 'grouping' => array(
307 'name' => 'grouping',
308 'type' => CRM_Utils_Type::T_INT,
309 'title' => ts('Grouping') ,
310 'description' => 'Used to group mapping_field records into related sets (e.g. for criteria sets in search builder
311 mappings).
312 ',
313 'default' => '1',
314 'table_name' => 'civicrm_mapping_field',
315 'entity' => 'MappingField',
316 'bao' => 'CRM_Core_DAO_MappingField',
317 'localizable' => 0,
318 ) ,
319 'operator' => array(
320 'name' => 'operator',
321 'type' => CRM_Utils_Type::T_STRING,
322 'title' => ts('Operator') ,
323 'description' => 'SQL WHERE operator for search-builder mapping fields (search criteria).',
324 'maxlength' => 16,
325 'size' => CRM_Utils_Type::TWELVE,
326 'table_name' => 'civicrm_mapping_field',
327 'entity' => 'MappingField',
328 'bao' => 'CRM_Core_DAO_MappingField',
329 'localizable' => 0,
330 'html' => array(
331 'type' => 'Select',
332 ) ,
333 'pseudoconstant' => array(
334 'callback' => 'CRM_Core_SelectValues::getSearchBuilderOperators',
335 )
336 ) ,
337 'value' => array(
338 'name' => 'value',
339 'type' => CRM_Utils_Type::T_STRING,
340 'title' => ts('Value') ,
341 'description' => 'SQL WHERE value for search-builder mapping fields.',
342 'maxlength' => 255,
343 'size' => CRM_Utils_Type::HUGE,
344 'table_name' => 'civicrm_mapping_field',
345 'entity' => 'MappingField',
346 'bao' => 'CRM_Core_DAO_MappingField',
347 'localizable' => 0,
348 ) ,
349 );
350 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
351 }
352 return Civi::$statics[__CLASS__]['fields'];
353 }
354 /**
355 * Return a mapping from field-name to the corresponding key (as used in fields()).
356 *
357 * @return array
358 * Array(string $name => string $uniqueName).
359 */
360 static function &fieldKeys() {
361 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
362 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
363 }
364 return Civi::$statics[__CLASS__]['fieldKeys'];
365 }
366 /**
367 * Returns the names of this table
368 *
369 * @return string
370 */
371 static function getTableName() {
372 return self::$_tableName;
373 }
374 /**
375 * Returns if this table needs to be logged
376 *
377 * @return boolean
378 */
379 function getLog() {
380 return self::$_log;
381 }
382 /**
383 * Returns the list of fields that can be imported
384 *
385 * @param bool $prefix
386 *
387 * @return array
388 */
389 static function &import($prefix = false) {
390 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mapping_field', $prefix, array());
391 return $r;
392 }
393 /**
394 * Returns the list of fields that can be exported
395 *
396 * @param bool $prefix
397 *
398 * @return array
399 */
400 static function &export($prefix = false) {
401 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mapping_field', $prefix, array());
402 return $r;
403 }
404 }