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:1488c12897446c8720328c904584442e)
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 value to see if we should log any modifications to
46 * this table in the civicrm_log table
58 * Mapping to which this field belongs
70 * Contact Type in mapping
76 * Column number for mapping set
80 public $column_number;
82 * Location type of this mapping, if required
86 public $location_type_id;
88 * Which type of phone does this number belongs.
92 public $phone_type_id;
94 * Which type of IM Provider does this name belong.
98 public $im_provider_id;
100 * Which type of website does this site belong
104 public $website_type_id;
106 * Relationship type, if required
110 public $relationship_type_id;
115 public $relationship_direction;
117 * Used to group mapping_field records into related sets (e.g. for criteria sets in search builder
124 * SQL WHERE operator for search-builder mapping fields (search criteria).
130 * SQL WHERE value for search-builder mapping fields.
138 * @return civicrm_mapping_field
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',
175 'mapping_id' => array(
176 'name' => 'mapping_id',
177 'type' => CRM_Utils_Type
::T_INT
,
178 'title' => ts('Mapping ID') ,
179 'description' => 'Mapping to which this field belongs',
181 'FKClassName' => 'CRM_Core_DAO_Mapping',
185 'type' => CRM_Utils_Type
::T_STRING
,
186 'title' => ts('Name') ,
187 'description' => 'Mapping field key',
189 'size' => CRM_Utils_Type
::HUGE
,
191 'contact_type' => array(
192 'name' => 'contact_type',
193 'type' => CRM_Utils_Type
::T_STRING
,
194 'title' => ts('Contact Type') ,
195 'description' => 'Contact Type in mapping',
197 'size' => CRM_Utils_Type
::BIG
,
202 'column_number' => array(
203 'name' => 'column_number',
204 'type' => CRM_Utils_Type
::T_INT
,
205 'title' => ts('Column Number') ,
206 'description' => 'Column number for mapping set',
209 'location_type_id' => array(
210 'name' => 'location_type_id',
211 'type' => CRM_Utils_Type
::T_INT
,
212 'title' => ts('Location type ID') ,
213 'description' => 'Location type of this mapping, if required',
214 'FKClassName' => 'CRM_Core_DAO_LocationType',
216 'phone_type_id' => array(
217 'name' => 'phone_type_id',
218 'type' => CRM_Utils_Type
::T_INT
,
219 'title' => ts('Phone type ID') ,
220 'description' => 'Which type of phone does this number belongs.',
222 'im_provider_id' => array(
223 'name' => 'im_provider_id',
224 'type' => CRM_Utils_Type
::T_INT
,
225 'title' => ts('IM provider ID') ,
226 'description' => 'Which type of IM Provider does this name belong.',
230 'pseudoconstant' => array(
231 'optionGroupName' => 'instant_messenger_service',
232 'optionEditPath' => 'civicrm/admin/options/instant_messenger_service',
235 'website_type_id' => array(
236 'name' => 'website_type_id',
237 'type' => CRM_Utils_Type
::T_INT
,
238 'title' => ts('Website type ID') ,
239 'description' => 'Which type of website does this site belong',
243 'pseudoconstant' => array(
244 'optionGroupName' => 'website_type',
245 'optionEditPath' => 'civicrm/admin/options/website_type',
248 'relationship_type_id' => array(
249 'name' => 'relationship_type_id',
250 'type' => CRM_Utils_Type
::T_INT
,
251 'title' => ts('Relationship type ID') ,
252 'description' => 'Relationship type, if required',
253 'FKClassName' => 'CRM_Contact_DAO_RelationshipType',
255 'relationship_direction' => array(
256 'name' => 'relationship_direction',
257 'type' => CRM_Utils_Type
::T_STRING
,
258 'title' => ts('Relationship Direction') ,
260 'size' => CRM_Utils_Type
::SIX
,
263 'name' => 'grouping',
264 'type' => CRM_Utils_Type
::T_INT
,
265 'title' => ts('Grouping') ,
266 'description' => 'Used to group mapping_field records into related sets (e.g. for criteria sets in search builder
272 'name' => 'operator',
273 'type' => CRM_Utils_Type
::T_STRING
,
274 'title' => ts('Operator') ,
275 'description' => 'SQL WHERE operator for search-builder mapping fields (search criteria).',
277 'size' => CRM_Utils_Type
::TWELVE
,
281 'pseudoconstant' => array(
282 'callback' => 'CRM_Core_SelectValues::getSearchBuilderOperators',
287 'type' => CRM_Utils_Type
::T_STRING
,
288 'title' => ts('Value') ,
289 'description' => 'SQL WHERE value for search-builder mapping fields.',
291 'size' => CRM_Utils_Type
::HUGE
,
294 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
296 return Civi
::$statics[__CLASS__
]['fields'];
299 * Return a mapping from field-name to the corresponding key (as used in fields()).
302 * Array(string $name => string $uniqueName).
304 static function &fieldKeys() {
305 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
306 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
308 return Civi
::$statics[__CLASS__
]['fieldKeys'];
311 * Returns the names of this table
315 static function getTableName() {
316 return self
::$_tableName;
319 * Returns if this table needs to be logged
327 * Returns the list of fields that can be imported
329 * @param bool $prefix
333 static function &import($prefix = false) {
334 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mapping_field', $prefix, array());
338 * Returns the list of fields that can be exported
340 * @param bool $prefix
344 static function &export($prefix = false) {
345 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mapping_field', $prefix, array());