3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Core/MappingField.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:3d48f11ca4d7d7bfbfa9125745b0f3e1)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_MappingField
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_mapping_field';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
90 * Mapping to which this field belongs
102 * Contact Type in mapping
106 public $contact_type;
108 * Column number for mapping set
112 public $column_number;
114 * Location type of this mapping, if required
118 public $location_type_id;
120 * Which type of phone does this number belongs.
124 public $phone_type_id;
126 * Which type of IM Provider does this name belong.
130 public $im_provider_id;
132 * Which type of website does this site belong
136 public $website_type_id;
138 * Relationship type, if required
142 public $relationship_type_id;
147 public $relationship_direction;
149 * Used to group mapping_field records into related sets (e.g. for criteria sets in search builder
156 * SQL WHERE operator for search-builder mapping fields (search criteria).
162 * SQL WHERE value for search-builder mapping fields.
170 * @return civicrm_mapping_field
172 function __construct() {
173 $this->__table
= 'civicrm_mapping_field';
174 parent
::__construct();
177 * Returns foreign keys and entity references
180 * [CRM_Core_Reference_Interface]
182 static function getReferenceColumns() {
183 if (!self
::$_links) {
184 self
::$_links = static ::createReferenceColumns(__CLASS__
);
185 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'mapping_id', 'civicrm_mapping', 'id');
186 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'location_type_id', 'civicrm_location_type', 'id');
187 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'relationship_type_id', 'civicrm_relationship_type', 'id');
189 return self
::$_links;
192 * Returns all the column names of this table
196 static function &fields() {
197 if (!(self
::$_fields)) {
198 self
::$_fields = array(
201 'type' => CRM_Utils_Type
::T_INT
,
202 'title' => ts('Mapping Field ID') ,
203 'description' => 'Mapping Field ID',
206 'mapping_id' => array(
207 'name' => 'mapping_id',
208 'type' => CRM_Utils_Type
::T_INT
,
209 'title' => ts('Mapping ID') ,
210 'description' => 'Mapping to which this field belongs',
212 'FKClassName' => 'CRM_Core_DAO_Mapping',
216 'type' => CRM_Utils_Type
::T_STRING
,
217 'title' => ts('Name') ,
218 'description' => 'Mapping field key',
220 'size' => CRM_Utils_Type
::HUGE
,
222 'contact_type' => array(
223 'name' => 'contact_type',
224 'type' => CRM_Utils_Type
::T_STRING
,
225 'title' => ts('Contact Type') ,
226 'description' => 'Contact Type in mapping',
228 'size' => CRM_Utils_Type
::BIG
,
233 'column_number' => array(
234 'name' => 'column_number',
235 'type' => CRM_Utils_Type
::T_INT
,
236 'title' => ts('Column Number') ,
237 'description' => 'Column number for mapping set',
240 'location_type_id' => array(
241 'name' => 'location_type_id',
242 'type' => CRM_Utils_Type
::T_INT
,
243 'title' => ts('Location type ID') ,
244 'description' => 'Location type of this mapping, if required',
245 'FKClassName' => 'CRM_Core_DAO_LocationType',
247 'phone_type_id' => array(
248 'name' => 'phone_type_id',
249 'type' => CRM_Utils_Type
::T_INT
,
250 'title' => ts('Phone type ID') ,
251 'description' => 'Which type of phone does this number belongs.',
253 'im_provider_id' => array(
254 'name' => 'im_provider_id',
255 'type' => CRM_Utils_Type
::T_INT
,
256 'title' => ts('IM provider ID') ,
257 'description' => 'Which type of IM Provider does this name belong.',
261 'pseudoconstant' => array(
262 'optionGroupName' => 'instant_messenger_service',
263 'optionEditPath' => 'civicrm/admin/options/instant_messenger_service',
266 'website_type_id' => array(
267 'name' => 'website_type_id',
268 'type' => CRM_Utils_Type
::T_INT
,
269 'title' => ts('Website type ID') ,
270 'description' => 'Which type of website does this site belong',
274 'pseudoconstant' => array(
275 'optionGroupName' => 'website_type',
276 'optionEditPath' => 'civicrm/admin/options/website_type',
279 'relationship_type_id' => array(
280 'name' => 'relationship_type_id',
281 'type' => CRM_Utils_Type
::T_INT
,
282 'title' => ts('Relationship type ID') ,
283 'description' => 'Relationship type, if required',
284 'FKClassName' => 'CRM_Contact_DAO_RelationshipType',
286 'relationship_direction' => array(
287 'name' => 'relationship_direction',
288 'type' => CRM_Utils_Type
::T_STRING
,
289 'title' => ts('Relationship Direction') ,
291 'size' => CRM_Utils_Type
::SIX
,
294 'name' => 'grouping',
295 'type' => CRM_Utils_Type
::T_INT
,
296 'title' => ts('Grouping') ,
297 'description' => 'Used to group mapping_field records into related sets (e.g. for criteria sets in search builder
303 'name' => 'operator',
304 'type' => CRM_Utils_Type
::T_STRING
,
305 'title' => ts('Operator') ,
306 'description' => 'SQL WHERE operator for search-builder mapping fields (search criteria).',
308 'size' => CRM_Utils_Type
::TWELVE
,
312 'pseudoconstant' => array(
313 'callback' => 'CRM_Core_SelectValues::getSearchBuilderOperators',
318 'type' => CRM_Utils_Type
::T_STRING
,
319 'title' => ts('Value') ,
320 'description' => 'SQL WHERE value for search-builder mapping fields.',
322 'size' => CRM_Utils_Type
::HUGE
,
326 return self
::$_fields;
329 * Returns an array containing, for each field, the arary key used for that
330 * field in self::$_fields.
334 static function &fieldKeys() {
335 if (!(self
::$_fieldKeys)) {
336 self
::$_fieldKeys = array(
338 'mapping_id' => 'mapping_id',
340 'contact_type' => 'contact_type',
341 'column_number' => 'column_number',
342 'location_type_id' => 'location_type_id',
343 'phone_type_id' => 'phone_type_id',
344 'im_provider_id' => 'im_provider_id',
345 'website_type_id' => 'website_type_id',
346 'relationship_type_id' => 'relationship_type_id',
347 'relationship_direction' => 'relationship_direction',
348 'grouping' => 'grouping',
349 'operator' => 'operator',
353 return self
::$_fieldKeys;
356 * Returns the names of this table
360 static function getTableName() {
361 return self
::$_tableName;
364 * Returns if this table needs to be logged
372 * Returns the list of fields that can be imported
374 * @param bool $prefix
378 static function &import($prefix = false) {
379 if (!(self
::$_import)) {
380 self
::$_import = array();
381 $fields = self
::fields();
382 foreach($fields as $name => $field) {
383 if (CRM_Utils_Array
::value('import', $field)) {
385 self
::$_import['mapping_field'] = & $fields[$name];
387 self
::$_import[$name] = & $fields[$name];
392 return self
::$_import;
395 * Returns the list of fields that can be exported
397 * @param bool $prefix
401 static function &export($prefix = false) {
402 if (!(self
::$_export)) {
403 self
::$_export = array();
404 $fields = self
::fields();
405 foreach($fields as $name => $field) {
406 if (CRM_Utils_Array
::value('export', $field)) {
408 self
::$_export['mapping_field'] = & $fields[$name];
410 self
::$_export[$name] = & $fields[$name];
415 return self
::$_export;