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/MappingField.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:6e729c48a9732fd57132ddfe6f9d02b9)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_MappingField constructor.
40 class CRM_Core_DAO_MappingField
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_mapping_field';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Mapping to which this field belongs
72 * Contact Type in mapping
78 * Column number for mapping set
82 public $column_number;
84 * Location type of this mapping, if required
88 public $location_type_id;
90 * Which type of phone does this number belongs.
94 public $phone_type_id;
96 * Which type of IM Provider does this name belong.
100 public $im_provider_id;
102 * Which type of website does this site belong
106 public $website_type_id;
108 * Relationship type, if required
112 public $relationship_type_id;
117 public $relationship_direction;
119 * Used to group mapping_field records into related sets (e.g. for criteria sets in search builder
126 * SQL WHERE operator for search-builder mapping fields (search criteria).
132 * SQL WHERE value for search-builder mapping fields.
140 function __construct() {
141 $this->__table
= 'civicrm_mapping_field';
142 parent
::__construct();
145 * Returns foreign keys and entity references.
148 * [CRM_Core_Reference_Interface]
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']);
158 return Civi
::$statics[__CLASS__
]['links'];
161 * Returns all the column names of this table
165 static function &fields() {
166 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
167 Civi
::$statics[__CLASS__
]['fields'] = array(
170 'type' => CRM_Utils_Type
::T_INT
,
171 'title' => ts('Mapping Field ID') ,
172 'description' => 'Mapping Field ID',
174 'table_name' => 'civicrm_mapping_field',
175 'entity' => 'MappingField',
176 'bao' => 'CRM_Core_DAO_MappingField',
178 'mapping_id' => array(
179 'name' => 'mapping_id',
180 'type' => CRM_Utils_Type
::T_INT
,
181 'title' => ts('Mapping ID') ,
182 'description' => 'Mapping to which this field belongs',
184 'table_name' => 'civicrm_mapping_field',
185 'entity' => 'MappingField',
186 'bao' => 'CRM_Core_DAO_MappingField',
187 'FKClassName' => 'CRM_Core_DAO_Mapping',
191 'type' => CRM_Utils_Type
::T_STRING
,
192 'title' => ts('Name') ,
193 'description' => 'Mapping field key',
195 'size' => CRM_Utils_Type
::HUGE
,
196 'table_name' => 'civicrm_mapping_field',
197 'entity' => 'MappingField',
198 'bao' => 'CRM_Core_DAO_MappingField',
200 'contact_type' => array(
201 'name' => 'contact_type',
202 'type' => CRM_Utils_Type
::T_STRING
,
203 'title' => ts('Contact Type') ,
204 'description' => 'Contact Type in mapping',
206 'size' => CRM_Utils_Type
::BIG
,
207 'table_name' => 'civicrm_mapping_field',
208 'entity' => 'MappingField',
209 'bao' => 'CRM_Core_DAO_MappingField',
214 'column_number' => array(
215 'name' => 'column_number',
216 'type' => CRM_Utils_Type
::T_INT
,
217 'title' => ts('Column Number') ,
218 'description' => 'Column number for mapping set',
220 'table_name' => 'civicrm_mapping_field',
221 'entity' => 'MappingField',
222 'bao' => 'CRM_Core_DAO_MappingField',
224 'location_type_id' => array(
225 'name' => 'location_type_id',
226 'type' => CRM_Utils_Type
::T_INT
,
227 'title' => ts('Location type ID') ,
228 'description' => 'Location type of this mapping, if required',
229 'table_name' => 'civicrm_mapping_field',
230 'entity' => 'MappingField',
231 'bao' => 'CRM_Core_DAO_MappingField',
232 'FKClassName' => 'CRM_Core_DAO_LocationType',
234 'phone_type_id' => array(
235 'name' => 'phone_type_id',
236 'type' => CRM_Utils_Type
::T_INT
,
237 'title' => ts('Phone type ID') ,
238 'description' => 'Which type of phone does this number belongs.',
239 'table_name' => 'civicrm_mapping_field',
240 'entity' => 'MappingField',
241 'bao' => 'CRM_Core_DAO_MappingField',
243 'im_provider_id' => array(
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',
254 'pseudoconstant' => array(
255 'optionGroupName' => 'instant_messenger_service',
256 'optionEditPath' => 'civicrm/admin/options/instant_messenger_service',
259 'website_type_id' => array(
260 'name' => 'website_type_id',
261 'type' => CRM_Utils_Type
::T_INT
,
262 'title' => ts('Website type ID') ,
263 'description' => 'Which type of website does this site belong',
264 'table_name' => 'civicrm_mapping_field',
265 'entity' => 'MappingField',
266 'bao' => 'CRM_Core_DAO_MappingField',
270 'pseudoconstant' => array(
271 'optionGroupName' => 'website_type',
272 'optionEditPath' => 'civicrm/admin/options/website_type',
275 'relationship_type_id' => array(
276 'name' => 'relationship_type_id',
277 'type' => CRM_Utils_Type
::T_INT
,
278 'title' => ts('Relationship type ID') ,
279 'description' => 'Relationship type, if required',
280 'table_name' => 'civicrm_mapping_field',
281 'entity' => 'MappingField',
282 'bao' => 'CRM_Core_DAO_MappingField',
283 'FKClassName' => 'CRM_Contact_DAO_RelationshipType',
285 'relationship_direction' => array(
286 'name' => 'relationship_direction',
287 'type' => CRM_Utils_Type
::T_STRING
,
288 'title' => ts('Relationship Direction') ,
290 'size' => CRM_Utils_Type
::SIX
,
291 'table_name' => 'civicrm_mapping_field',
292 'entity' => 'MappingField',
293 'bao' => 'CRM_Core_DAO_MappingField',
296 'name' => 'grouping',
297 'type' => CRM_Utils_Type
::T_INT
,
298 'title' => ts('Grouping') ,
299 'description' => 'Used to group mapping_field records into related sets (e.g. for criteria sets in search builder
303 'table_name' => 'civicrm_mapping_field',
304 'entity' => 'MappingField',
305 'bao' => 'CRM_Core_DAO_MappingField',
308 'name' => 'operator',
309 'type' => CRM_Utils_Type
::T_STRING
,
310 'title' => ts('Operator') ,
311 'description' => 'SQL WHERE operator for search-builder mapping fields (search criteria).',
313 'size' => CRM_Utils_Type
::TWELVE
,
314 'table_name' => 'civicrm_mapping_field',
315 'entity' => 'MappingField',
316 'bao' => 'CRM_Core_DAO_MappingField',
320 'pseudoconstant' => array(
321 'callback' => 'CRM_Core_SelectValues::getSearchBuilderOperators',
326 'type' => CRM_Utils_Type
::T_STRING
,
327 'title' => ts('Value') ,
328 'description' => 'SQL WHERE value for search-builder mapping fields.',
330 'size' => CRM_Utils_Type
::HUGE
,
331 'table_name' => 'civicrm_mapping_field',
332 'entity' => 'MappingField',
333 'bao' => 'CRM_Core_DAO_MappingField',
336 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
338 return Civi
::$statics[__CLASS__
]['fields'];
341 * Return a mapping from field-name to the corresponding key (as used in fields()).
344 * Array(string $name => string $uniqueName).
346 static function &fieldKeys() {
347 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
348 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
350 return Civi
::$statics[__CLASS__
]['fieldKeys'];
353 * Returns the names of this table
357 static function getTableName() {
358 return self
::$_tableName;
361 * Returns if this table needs to be logged
369 * Returns the list of fields that can be imported
371 * @param bool $prefix
375 static function &import($prefix = false) {
376 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mapping_field', $prefix, array());
380 * Returns the list of fields that can be exported
382 * @param bool $prefix
386 static function &export($prefix = false) {
387 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mapping_field', $prefix, array());