5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Core/MappingField.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:6e729c48a9732fd57132ddfe6f9d02b9)
13 * Database access object for the MappingField entity.
15 class CRM_Core_DAO_MappingField
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_mapping_field';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
39 * Mapping to which this field belongs
53 * Contact Type in mapping
60 * Column number for mapping set
64 public $column_number;
67 * Location type of this mapping, if required
71 public $location_type_id;
74 * Which type of phone does this number belongs.
78 public $phone_type_id;
81 * Which type of IM Provider does this name belong.
85 public $im_provider_id;
88 * Which type of website does this site belong
92 public $website_type_id;
95 * Relationship type, if required
99 public $relationship_type_id;
104 public $relationship_direction;
107 * Used to group mapping_field records into related sets (e.g. for criteria sets in search builder
115 * SQL WHERE operator for search-builder mapping fields (search criteria).
122 * SQL WHERE value for search-builder mapping fields.
131 public function __construct() {
132 $this->__table
= 'civicrm_mapping_field';
133 parent
::__construct();
137 * Returns foreign keys and entity references.
140 * [CRM_Core_Reference_Interface]
142 public static function getReferenceColumns() {
143 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
144 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
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');
148 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
150 return Civi
::$statics[__CLASS__
]['links'];
154 * Returns all the column names of this table
158 public static function &fields() {
159 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
160 Civi
::$statics[__CLASS__
]['fields'] = [
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('Mapping Field ID'),
165 'description' => 'Mapping Field ID',
167 'table_name' => 'civicrm_mapping_field',
168 'entity' => 'MappingField',
169 'bao' => 'CRM_Core_DAO_MappingField',
173 'name' => 'mapping_id',
174 'type' => CRM_Utils_Type
::T_INT
,
175 'title' => ts('Mapping ID'),
176 'description' => 'Mapping to which this field belongs',
178 'table_name' => 'civicrm_mapping_field',
179 'entity' => 'MappingField',
180 'bao' => 'CRM_Core_DAO_MappingField',
182 'FKClassName' => 'CRM_Core_DAO_Mapping',
186 'type' => CRM_Utils_Type
::T_STRING
,
187 'title' => ts('Name'),
188 'description' => 'Mapping field key',
190 'size' => CRM_Utils_Type
::HUGE
,
191 'table_name' => 'civicrm_mapping_field',
192 'entity' => 'MappingField',
193 'bao' => 'CRM_Core_DAO_MappingField',
197 'name' => 'contact_type',
198 'type' => CRM_Utils_Type
::T_STRING
,
199 'title' => ts('Contact Type'),
200 'description' => 'Contact Type in mapping',
202 'size' => CRM_Utils_Type
::BIG
,
203 'table_name' => 'civicrm_mapping_field',
204 'entity' => 'MappingField',
205 'bao' => 'CRM_Core_DAO_MappingField',
212 'name' => 'column_number',
213 'type' => CRM_Utils_Type
::T_INT
,
214 'title' => ts('Column Number'),
215 'description' => 'Column number for mapping set',
217 'table_name' => 'civicrm_mapping_field',
218 'entity' => 'MappingField',
219 'bao' => 'CRM_Core_DAO_MappingField',
222 'location_type_id' => [
223 'name' => 'location_type_id',
224 'type' => CRM_Utils_Type
::T_INT
,
225 'title' => ts('Location type ID'),
226 'description' => 'Location type of this mapping, if required',
227 'table_name' => 'civicrm_mapping_field',
228 'entity' => 'MappingField',
229 'bao' => 'CRM_Core_DAO_MappingField',
231 'FKClassName' => 'CRM_Core_DAO_LocationType',
234 'name' => 'phone_type_id',
235 'type' => CRM_Utils_Type
::T_INT
,
236 'title' => ts('Phone type ID'),
237 'description' => 'Which type of phone does this number belongs.',
238 'table_name' => 'civicrm_mapping_field',
239 'entity' => 'MappingField',
240 'bao' => 'CRM_Core_DAO_MappingField',
243 'im_provider_id' => [
244 'name' => 'im_provider_id',
245 'type' => CRM_Utils_Type
::T_INT
,
246 'title' => ts('IM provider ID'),
247 'description' => 'Which type of IM Provider does this name belong.',
248 'table_name' => 'civicrm_mapping_field',
249 'entity' => 'MappingField',
250 'bao' => 'CRM_Core_DAO_MappingField',
255 'pseudoconstant' => [
256 'optionGroupName' => 'instant_messenger_service',
257 'optionEditPath' => 'civicrm/admin/options/instant_messenger_service',
260 'website_type_id' => [
261 'name' => 'website_type_id',
262 'type' => CRM_Utils_Type
::T_INT
,
263 'title' => ts('Website type ID'),
264 'description' => 'Which type of website does this site belong',
265 'table_name' => 'civicrm_mapping_field',
266 'entity' => 'MappingField',
267 'bao' => 'CRM_Core_DAO_MappingField',
272 'pseudoconstant' => [
273 'optionGroupName' => 'website_type',
274 'optionEditPath' => 'civicrm/admin/options/website_type',
277 'relationship_type_id' => [
278 'name' => 'relationship_type_id',
279 'type' => CRM_Utils_Type
::T_INT
,
280 'title' => ts('Relationship type ID'),
281 'description' => 'Relationship type, if required',
282 'table_name' => 'civicrm_mapping_field',
283 'entity' => 'MappingField',
284 'bao' => 'CRM_Core_DAO_MappingField',
286 'FKClassName' => 'CRM_Contact_DAO_RelationshipType',
288 'relationship_direction' => [
289 'name' => 'relationship_direction',
290 'type' => CRM_Utils_Type
::T_STRING
,
291 'title' => ts('Relationship Direction'),
293 'size' => CRM_Utils_Type
::SIX
,
294 'table_name' => 'civicrm_mapping_field',
295 'entity' => 'MappingField',
296 'bao' => 'CRM_Core_DAO_MappingField',
300 'name' => 'grouping',
301 'type' => CRM_Utils_Type
::T_INT
,
302 'title' => ts('Grouping'),
303 'description' => 'Used to group mapping_field records into related sets (e.g. for criteria sets in search builder
307 'table_name' => 'civicrm_mapping_field',
308 'entity' => 'MappingField',
309 'bao' => 'CRM_Core_DAO_MappingField',
313 'name' => 'operator',
314 'type' => CRM_Utils_Type
::T_STRING
,
315 'title' => ts('Operator'),
316 'description' => 'SQL WHERE operator for search-builder mapping fields (search criteria).',
318 'size' => CRM_Utils_Type
::TWELVE
,
319 'table_name' => 'civicrm_mapping_field',
320 'entity' => 'MappingField',
321 'bao' => 'CRM_Core_DAO_MappingField',
326 'pseudoconstant' => [
327 'callback' => 'CRM_Core_SelectValues::getSearchBuilderOperators',
332 'type' => CRM_Utils_Type
::T_STRING
,
333 'title' => ts('Value'),
334 'description' => 'SQL WHERE value for search-builder mapping fields.',
336 'size' => CRM_Utils_Type
::HUGE
,
337 'table_name' => 'civicrm_mapping_field',
338 'entity' => 'MappingField',
339 'bao' => 'CRM_Core_DAO_MappingField',
343 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
345 return Civi
::$statics[__CLASS__
]['fields'];
349 * Return a mapping from field-name to the corresponding key (as used in fields()).
352 * Array(string $name => string $uniqueName).
354 public static function &fieldKeys() {
355 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
356 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
358 return Civi
::$statics[__CLASS__
]['fieldKeys'];
362 * Returns the names of this table
366 public static function getTableName() {
367 return self
::$_tableName;
371 * Returns if this table needs to be logged
375 public function getLog() {
380 * Returns the list of fields that can be imported
382 * @param bool $prefix
386 public static function &import($prefix = FALSE) {
387 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mapping_field', $prefix, []);
392 * Returns the list of fields that can be exported
394 * @param bool $prefix
398 public static function &export($prefix = FALSE) {
399 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mapping_field', $prefix, []);
404 * Returns the list of indices
406 * @param bool $localize
410 public static function indices($localize = TRUE) {
412 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;