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