5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Core/UFField.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:4777c5b97760d4bd4b7138468d18ded5)
13 * Database access object for the UFField entity.
15 class CRM_Core_DAO_UFField
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_uf_field';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
39 * Which form does this field belong to.
46 * Name for CiviCRM field which is being exposed for sharing.
53 * Is this field currently shareable? If false, hide the field for all sharing contexts.
60 * the field is view only and not editable in user forms.
67 * Is this field required when included in a user or registration form?
74 * Controls field display order when user framework fields are displayed in registration and account editing forms.
81 * Description and/or help text to display after this field.
88 * Description and/or help text to display before this field.
95 * In what context(s) is this field visible.
102 * Is this field included as a column in the selector table?
109 * Is this field included search form of profile?
113 public $is_searchable;
116 * Location type of this mapping, if required
120 public $location_type_id;
123 * Phone Type Id, if required
127 public $phone_type_id;
130 * Website Type Id, if required
134 public $website_type_id;
137 * To save label for fields.
144 * This field saves field type (ie individual,household.. field etc).
151 * Is this field reserved for use by some other CiviCRM functionality?
158 * Include in multi-record listing?
162 public $is_multi_summary;
167 public function __construct() {
168 $this->__table
= 'civicrm_uf_field';
169 parent
::__construct();
173 * Returns foreign keys and entity references.
176 * [CRM_Core_Reference_Interface]
178 public static function getReferenceColumns() {
179 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
180 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
181 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'uf_group_id', 'civicrm_uf_group', 'id');
182 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'location_type_id', 'civicrm_location_type', 'id');
183 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
185 return Civi
::$statics[__CLASS__
]['links'];
189 * Returns all the column names of this table
193 public static function &fields() {
194 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
195 Civi
::$statics[__CLASS__
]['fields'] = [
198 'type' => CRM_Utils_Type
::T_INT
,
199 'title' => ts('Profile Field ID'),
200 'description' => 'Unique table ID',
202 'table_name' => 'civicrm_uf_field',
203 'entity' => 'UFField',
204 'bao' => 'CRM_Core_BAO_UFField',
208 'name' => 'uf_group_id',
209 'type' => CRM_Utils_Type
::T_INT
,
210 'title' => ts('Profile ID'),
211 'description' => 'Which form does this field belong to.',
213 'table_name' => 'civicrm_uf_field',
214 'entity' => 'UFField',
215 'bao' => 'CRM_Core_BAO_UFField',
217 'FKClassName' => 'CRM_Core_DAO_UFGroup',
221 'pseudoconstant' => [
222 'table' => 'civicrm_uf_group',
224 'labelColumn' => 'title',
228 'name' => 'field_name',
229 'type' => CRM_Utils_Type
::T_STRING
,
230 'title' => ts('Profile Field Name'),
231 'description' => 'Name for CiviCRM field which is being exposed for sharing.',
234 'size' => CRM_Utils_Type
::BIG
,
235 'table_name' => 'civicrm_uf_field',
236 'entity' => 'UFField',
237 'bao' => 'CRM_Core_BAO_UFField',
241 'name' => 'is_active',
242 'type' => CRM_Utils_Type
::T_BOOLEAN
,
243 'title' => ts('Profile Field Is Active'),
244 'description' => 'Is this field currently shareable? If false, hide the field for all sharing contexts.',
246 'table_name' => 'civicrm_uf_field',
247 'entity' => 'UFField',
248 'bao' => 'CRM_Core_BAO_UFField',
253 'type' => CRM_Utils_Type
::T_BOOLEAN
,
254 'title' => ts('Profile Is View Only'),
255 'description' => 'the field is view only and not editable in user forms.',
256 'table_name' => 'civicrm_uf_field',
257 'entity' => 'UFField',
258 'bao' => 'CRM_Core_BAO_UFField',
262 'name' => 'is_required',
263 'type' => CRM_Utils_Type
::T_BOOLEAN
,
264 'title' => ts('Profile Field Is Required'),
265 'description' => 'Is this field required when included in a user or registration form?',
266 'table_name' => 'civicrm_uf_field',
267 'entity' => 'UFField',
268 'bao' => 'CRM_Core_BAO_UFField',
273 'type' => CRM_Utils_Type
::T_INT
,
274 'title' => ts('Order'),
275 'description' => 'Controls field display order when user framework fields are displayed in registration and account editing forms.',
278 'table_name' => 'civicrm_uf_field',
279 'entity' => 'UFField',
280 'bao' => 'CRM_Core_BAO_UFField',
284 'name' => 'help_post',
285 'type' => CRM_Utils_Type
::T_TEXT
,
286 'title' => ts('Profile Field Post Help'),
287 'description' => 'Description and/or help text to display after this field.',
288 'table_name' => 'civicrm_uf_field',
289 'entity' => 'UFField',
290 'bao' => 'CRM_Core_BAO_UFField',
294 'name' => 'help_pre',
295 'type' => CRM_Utils_Type
::T_TEXT
,
296 'title' => ts('Profile Field Pre Help'),
297 'description' => 'Description and/or help text to display before this field.',
298 'table_name' => 'civicrm_uf_field',
299 'entity' => 'UFField',
300 'bao' => 'CRM_Core_BAO_UFField',
304 'name' => 'visibility',
305 'type' => CRM_Utils_Type
::T_STRING
,
306 'title' => ts('Profile Field Visibility'),
307 'description' => 'In what context(s) is this field visible.',
309 'size' => CRM_Utils_Type
::MEDIUM
,
310 'default' => 'User and User Admin Only',
311 'table_name' => 'civicrm_uf_field',
312 'entity' => 'UFField',
313 'bao' => 'CRM_Core_BAO_UFField',
318 'pseudoconstant' => [
319 'callback' => 'CRM_Core_SelectValues::ufVisibility',
323 'name' => 'in_selector',
324 'type' => CRM_Utils_Type
::T_BOOLEAN
,
325 'title' => ts('Profile Field Is a Filter'),
326 'description' => 'Is this field included as a column in the selector table?',
327 'table_name' => 'civicrm_uf_field',
328 'entity' => 'UFField',
329 'bao' => 'CRM_Core_BAO_UFField',
333 'name' => 'is_searchable',
334 'type' => CRM_Utils_Type
::T_BOOLEAN
,
335 'title' => ts('Profile Field Is Searchable'),
336 'description' => 'Is this field included search form of profile?',
337 'table_name' => 'civicrm_uf_field',
338 'entity' => 'UFField',
339 'bao' => 'CRM_Core_BAO_UFField',
342 'location_type_id' => [
343 'name' => 'location_type_id',
344 'type' => CRM_Utils_Type
::T_INT
,
345 'title' => ts('Profile Field Location Type'),
346 'description' => 'Location type of this mapping, if required',
347 'table_name' => 'civicrm_uf_field',
348 'entity' => 'UFField',
349 'bao' => 'CRM_Core_BAO_UFField',
351 'FKClassName' => 'CRM_Core_DAO_LocationType',
354 'name' => 'phone_type_id',
355 'type' => CRM_Utils_Type
::T_INT
,
356 'title' => ts('Profile Field Phone Type'),
357 'description' => 'Phone Type Id, if required',
358 'table_name' => 'civicrm_uf_field',
359 'entity' => 'UFField',
360 'bao' => 'CRM_Core_BAO_UFField',
363 'website_type_id' => [
364 'name' => 'website_type_id',
365 'type' => CRM_Utils_Type
::T_INT
,
366 'title' => ts('Profile Field Website Type'),
367 'description' => 'Website Type Id, if required',
368 'table_name' => 'civicrm_uf_field',
369 'entity' => 'UFField',
370 'bao' => 'CRM_Core_BAO_UFField',
375 'type' => CRM_Utils_Type
::T_STRING
,
376 'title' => ts('Profile Field Label'),
377 'description' => 'To save label for fields.',
380 'size' => CRM_Utils_Type
::HUGE
,
381 'table_name' => 'civicrm_uf_field',
382 'entity' => 'UFField',
383 'bao' => 'CRM_Core_BAO_UFField',
387 'name' => 'field_type',
388 'type' => CRM_Utils_Type
::T_STRING
,
389 'title' => ts('Profile Field Type'),
390 'description' => 'This field saves field type (ie individual,household.. field etc).',
392 'size' => CRM_Utils_Type
::HUGE
,
393 'table_name' => 'civicrm_uf_field',
394 'entity' => 'UFField',
395 'bao' => 'CRM_Core_BAO_UFField',
399 'name' => 'is_reserved',
400 'type' => CRM_Utils_Type
::T_BOOLEAN
,
401 'title' => ts('Profile Field Is Reserved'),
402 'description' => 'Is this field reserved for use by some other CiviCRM functionality?',
403 'table_name' => 'civicrm_uf_field',
404 'entity' => 'UFField',
405 'bao' => 'CRM_Core_BAO_UFField',
408 'is_multi_summary' => [
409 'name' => 'is_multi_summary',
410 'type' => CRM_Utils_Type
::T_BOOLEAN
,
411 'title' => ts('Profile Field Supports Multiple'),
412 'description' => 'Include in multi-record listing?',
413 'table_name' => 'civicrm_uf_field',
414 'entity' => 'UFField',
415 'bao' => 'CRM_Core_BAO_UFField',
419 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
421 return Civi
::$statics[__CLASS__
]['fields'];
425 * Return a mapping from field-name to the corresponding key (as used in fields()).
428 * Array(string $name => string $uniqueName).
430 public static function &fieldKeys() {
431 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
432 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
434 return Civi
::$statics[__CLASS__
]['fieldKeys'];
438 * Returns the names of this table
442 public static function getTableName() {
443 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
447 * Returns if this table needs to be logged
451 public function getLog() {
456 * Returns the list of fields that can be imported
458 * @param bool $prefix
462 public static function &import($prefix = FALSE) {
463 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_field', $prefix, []);
468 * Returns the list of fields that can be exported
470 * @param bool $prefix
474 public static function &export($prefix = FALSE) {
475 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_field', $prefix, []);
480 * Returns the list of indices
482 * @param bool $localize
486 public static function indices($localize = TRUE) {
488 'IX_website_type_id' => [
489 'name' => 'IX_website_type_id',
491 0 => 'website_type_id',
493 'localizable' => FALSE,
494 'sig' => 'civicrm_uf_field::0::website_type_id',
497 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;