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',
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',
185 'table_name' => 'civicrm_mapping_field',
186 'entity' => 'MappingField',
187 'bao' => 'CRM_Core_DAO_MappingField',
189 'FKClassName' => 'CRM_Core_DAO_Mapping',
193 'type' => CRM_Utils_Type
::T_STRING
,
194 'title' => ts('Name') ,
195 'description' => 'Mapping field key',
197 'size' => CRM_Utils_Type
::HUGE
,
198 'table_name' => 'civicrm_mapping_field',
199 'entity' => 'MappingField',
200 'bao' => 'CRM_Core_DAO_MappingField',
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',
209 'size' => CRM_Utils_Type
::BIG
,
210 'table_name' => 'civicrm_mapping_field',
211 'entity' => 'MappingField',
212 'bao' => 'CRM_Core_DAO_MappingField',
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',
224 'table_name' => 'civicrm_mapping_field',
225 'entity' => 'MappingField',
226 'bao' => 'CRM_Core_DAO_MappingField',
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',
238 'FKClassName' => 'CRM_Core_DAO_LocationType',
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',
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',
262 'pseudoconstant' => array(
263 'optionGroupName' => 'instant_messenger_service',
264 'optionEditPath' => 'civicrm/admin/options/instant_messenger_service',
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',
279 'pseudoconstant' => array(
280 'optionGroupName' => 'website_type',
281 'optionEditPath' => 'civicrm/admin/options/website_type',
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',
293 'FKClassName' => 'CRM_Contact_DAO_RelationshipType',
295 'relationship_direction' => array(
296 'name' => 'relationship_direction',
297 'type' => CRM_Utils_Type
::T_STRING
,
298 'title' => ts('Relationship Direction') ,
300 'size' => CRM_Utils_Type
::SIX
,
301 'table_name' => 'civicrm_mapping_field',
302 'entity' => 'MappingField',
303 'bao' => 'CRM_Core_DAO_MappingField',
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
314 'table_name' => 'civicrm_mapping_field',
315 'entity' => 'MappingField',
316 'bao' => 'CRM_Core_DAO_MappingField',
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).',
325 'size' => CRM_Utils_Type
::TWELVE
,
326 'table_name' => 'civicrm_mapping_field',
327 'entity' => 'MappingField',
328 'bao' => 'CRM_Core_DAO_MappingField',
333 'pseudoconstant' => array(
334 'callback' => 'CRM_Core_SelectValues::getSearchBuilderOperators',
339 'type' => CRM_Utils_Type
::T_STRING
,
340 'title' => ts('Value') ,
341 'description' => 'SQL WHERE value for search-builder mapping fields.',
343 'size' => CRM_Utils_Type
::HUGE
,
344 'table_name' => 'civicrm_mapping_field',
345 'entity' => 'MappingField',
346 'bao' => 'CRM_Core_DAO_MappingField',
350 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
352 return Civi
::$statics[__CLASS__
]['fields'];
355 * Return a mapping from field-name to the corresponding key (as used in fields()).
358 * Array(string $name => string $uniqueName).
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()));
364 return Civi
::$statics[__CLASS__
]['fieldKeys'];
367 * Returns the names of this table
371 static function getTableName() {
372 return self
::$_tableName;
375 * Returns if this table needs to be logged
383 * Returns the list of fields that can be imported
385 * @param bool $prefix
389 static function &import($prefix = false) {
390 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mapping_field', $prefix, array());
394 * Returns the list of fields that can be exported
396 * @param bool $prefix
400 static function &export($prefix = false) {
401 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mapping_field', $prefix, array());
405 * Returns the list of indices
407 public static function indices($localize = TRUE) {
409 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;