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/UFField.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:4565f52f669979587f1e3e1b6f6a1684)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_UFField
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_uf_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 value to see if we should log any modifications to
64 * this table in the civicrm_log table
76 * Which form does this field belong to.
82 * Name for CiviCRM field which is being exposed for sharing.
88 * Is this field currently shareable? If false, hide the field for all sharing contexts.
94 * the field is view only and not editable in user forms.
100 * Is this field required when included in a user or registration form?
106 * Controls field display order when user framework fields are displayed in registration and account editing forms.
112 * Description and/or help text to display after this field.
118 * Description and/or help text to display before this field.
124 * In what context(s) is this field visible.
130 * Is this field included as a column in the selector table?
136 * Is this field included search form of profile?
140 public $is_searchable;
142 * Location type of this mapping, if required
146 public $location_type_id;
148 * Phone Type Id, if required
152 public $phone_type_id;
154 * Website Type Id, if required
158 public $website_type_id;
160 * To save label for fields.
166 * This field saves field type (ie individual,household.. field etc).
172 * Is this field reserved for use by some other CiviCRM functionality?
178 * Include in multi-record listing?
182 public $is_multi_summary;
186 * @return civicrm_uf_field
188 function __construct() {
189 $this->__table
= 'civicrm_uf_field';
190 parent
::__construct();
193 * Returns foreign keys and entity references
196 * [CRM_Core_Reference_Interface]
198 static function getReferenceColumns() {
199 if (!self
::$_links) {
200 self
::$_links = static ::createReferenceColumns(__CLASS__
);
201 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'uf_group_id', 'civicrm_uf_group', 'id');
202 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'location_type_id', 'civicrm_location_type', 'id');
204 return self
::$_links;
207 * Returns all the column names of this table
211 static function &fields() {
212 if (!(self
::$_fields)) {
213 self
::$_fields = array(
216 'type' => CRM_Utils_Type
::T_INT
,
217 'title' => ts('Profile Field ID') ,
218 'description' => 'Unique table ID',
221 'uf_group_id' => array(
222 'name' => 'uf_group_id',
223 'type' => CRM_Utils_Type
::T_INT
,
224 'title' => ts('Profile ID') ,
225 'description' => 'Which form does this field belong to.',
227 'FKClassName' => 'CRM_Core_DAO_UFGroup',
231 'pseudoconstant' => array(
232 'table' => 'civicrm_uf_group',
234 'labelColumn' => 'title',
237 'field_name' => array(
238 'name' => 'field_name',
239 'type' => CRM_Utils_Type
::T_STRING
,
240 'title' => ts('Profile Field Name') ,
241 'description' => 'Name for CiviCRM field which is being exposed for sharing.',
244 'size' => CRM_Utils_Type
::BIG
,
246 'is_active' => array(
247 'name' => 'is_active',
248 'type' => CRM_Utils_Type
::T_BOOLEAN
,
249 'title' => ts('Profile Field Is Active') ,
250 'description' => 'Is this field currently shareable? If false, hide the field for all sharing contexts.',
255 'type' => CRM_Utils_Type
::T_BOOLEAN
,
256 'title' => ts('Profile Is View Only') ,
257 'description' => 'the field is view only and not editable in user forms.',
259 'is_required' => array(
260 'name' => 'is_required',
261 'type' => CRM_Utils_Type
::T_BOOLEAN
,
262 'title' => ts('Profile Field Is Required') ,
263 'description' => 'Is this field required when included in a user or registration form?',
267 'type' => CRM_Utils_Type
::T_INT
,
268 'title' => ts('Order') ,
269 'description' => 'Controls field display order when user framework fields are displayed in registration and account editing forms.',
273 'help_post' => array(
274 'name' => 'help_post',
275 'type' => CRM_Utils_Type
::T_TEXT
,
276 'title' => ts('Profile Field Post Help') ,
277 'description' => 'Description and/or help text to display after this field.',
280 'name' => 'help_pre',
281 'type' => CRM_Utils_Type
::T_TEXT
,
282 'title' => ts('Profile Field Pre Help') ,
283 'description' => 'Description and/or help text to display before this field.',
285 'visibility' => array(
286 'name' => 'visibility',
287 'type' => CRM_Utils_Type
::T_STRING
,
288 'title' => ts('Profile Field Visibility') ,
289 'description' => 'In what context(s) is this field visible.',
291 'size' => CRM_Utils_Type
::MEDIUM
,
292 'default' => 'User and User Admin Only',
296 'pseudoconstant' => array(
297 'callback' => 'CRM_Core_SelectValues::ufVisibility',
300 'in_selector' => array(
301 'name' => 'in_selector',
302 'type' => CRM_Utils_Type
::T_BOOLEAN
,
303 'title' => ts('Profile Field Is a Filter') ,
304 'description' => 'Is this field included as a column in the selector table?',
306 'is_searchable' => array(
307 'name' => 'is_searchable',
308 'type' => CRM_Utils_Type
::T_BOOLEAN
,
309 'title' => ts('Profile Field Is Searchable') ,
310 'description' => 'Is this field included search form of profile?',
312 'location_type_id' => array(
313 'name' => 'location_type_id',
314 'type' => CRM_Utils_Type
::T_INT
,
315 'title' => ts('Profile Field Location Type') ,
316 'description' => 'Location type of this mapping, if required',
317 'FKClassName' => 'CRM_Core_DAO_LocationType',
319 'phone_type_id' => array(
320 'name' => 'phone_type_id',
321 'type' => CRM_Utils_Type
::T_INT
,
322 'title' => ts('Profile Field Phone Type') ,
323 'description' => 'Phone Type Id, if required',
325 'website_type_id' => array(
326 'name' => 'website_type_id',
327 'type' => CRM_Utils_Type
::T_INT
,
328 'title' => ts('Profile Field Website Type') ,
329 'description' => 'Website Type Id, if required',
333 'type' => CRM_Utils_Type
::T_STRING
,
334 'title' => ts('Profile Field Label') ,
335 'description' => 'To save label for fields.',
338 'size' => CRM_Utils_Type
::HUGE
,
340 'field_type' => array(
341 'name' => 'field_type',
342 'type' => CRM_Utils_Type
::T_STRING
,
343 'title' => ts('Profile Field Type') ,
344 'description' => 'This field saves field type (ie individual,household.. field etc).',
346 'size' => CRM_Utils_Type
::HUGE
,
348 'is_reserved' => array(
349 'name' => 'is_reserved',
350 'type' => CRM_Utils_Type
::T_BOOLEAN
,
351 'title' => ts('Profile Field Is Reserved') ,
352 'description' => 'Is this field reserved for use by some other CiviCRM functionality?',
354 'is_multi_summary' => array(
355 'name' => 'is_multi_summary',
356 'type' => CRM_Utils_Type
::T_BOOLEAN
,
357 'title' => ts('Profile Field Supports Multiple') ,
358 'description' => 'Include in multi-record listing?',
362 return self
::$_fields;
365 * Returns an array containing, for each field, the arary key used for that
366 * field in self::$_fields.
370 static function &fieldKeys() {
371 if (!(self
::$_fieldKeys)) {
372 self
::$_fieldKeys = array(
374 'uf_group_id' => 'uf_group_id',
375 'field_name' => 'field_name',
376 'is_active' => 'is_active',
377 'is_view' => 'is_view',
378 'is_required' => 'is_required',
379 'weight' => 'weight',
380 'help_post' => 'help_post',
381 'help_pre' => 'help_pre',
382 'visibility' => 'visibility',
383 'in_selector' => 'in_selector',
384 'is_searchable' => 'is_searchable',
385 'location_type_id' => 'location_type_id',
386 'phone_type_id' => 'phone_type_id',
387 'website_type_id' => 'website_type_id',
389 'field_type' => 'field_type',
390 'is_reserved' => 'is_reserved',
391 'is_multi_summary' => 'is_multi_summary',
394 return self
::$_fieldKeys;
397 * Returns the names of this table
401 static function getTableName() {
402 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
405 * Returns if this table needs to be logged
413 * Returns the list of fields that can be imported
415 * @param bool $prefix
419 static function &import($prefix = false) {
420 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_field', $prefix, array());
424 * Returns the list of fields that can be exported
426 * @param bool $prefix
430 static function &export($prefix = false) {
431 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_field', $prefix, array());