5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/UFField.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:efbfbe95aac7abe98b31ab715965b57f)
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' => ts('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' => ts('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' => ts('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' => ts('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' => ts('the field is view only and not editable in user forms.'),
257 'table_name' => 'civicrm_uf_field',
258 'entity' => 'UFField',
259 'bao' => 'CRM_Core_BAO_UFField',
263 'name' => 'is_required',
264 'type' => CRM_Utils_Type
::T_BOOLEAN
,
265 'title' => ts('Profile Field Is Required'),
266 'description' => ts('Is this field required when included in a user or registration form?'),
268 'table_name' => 'civicrm_uf_field',
269 'entity' => 'UFField',
270 'bao' => 'CRM_Core_BAO_UFField',
275 'type' => CRM_Utils_Type
::T_INT
,
276 'title' => ts('Order'),
277 'description' => ts('Controls field display order when user framework fields are displayed in registration and account editing forms.'),
280 'table_name' => 'civicrm_uf_field',
281 'entity' => 'UFField',
282 'bao' => 'CRM_Core_BAO_UFField',
286 'name' => 'help_post',
287 'type' => CRM_Utils_Type
::T_TEXT
,
288 'title' => ts('Profile Field Post Help'),
289 'description' => ts('Description and/or help text to display after this field.'),
290 'table_name' => 'civicrm_uf_field',
291 'entity' => 'UFField',
292 'bao' => 'CRM_Core_BAO_UFField',
296 'name' => 'help_pre',
297 'type' => CRM_Utils_Type
::T_TEXT
,
298 'title' => ts('Profile Field Pre Help'),
299 'description' => ts('Description and/or help text to display before this field.'),
300 'table_name' => 'civicrm_uf_field',
301 'entity' => 'UFField',
302 'bao' => 'CRM_Core_BAO_UFField',
306 'name' => 'visibility',
307 'type' => CRM_Utils_Type
::T_STRING
,
308 'title' => ts('Profile Field Visibility'),
309 'description' => ts('In what context(s) is this field visible.'),
311 'size' => CRM_Utils_Type
::MEDIUM
,
312 'default' => 'User and User Admin Only',
313 'table_name' => 'civicrm_uf_field',
314 'entity' => 'UFField',
315 'bao' => 'CRM_Core_BAO_UFField',
320 'pseudoconstant' => [
321 'callback' => 'CRM_Core_SelectValues::ufVisibility',
325 'name' => 'in_selector',
326 'type' => CRM_Utils_Type
::T_BOOLEAN
,
327 'title' => ts('Profile Field Is a Filter'),
328 'description' => ts('Is this field included as a column in the selector table?'),
330 'table_name' => 'civicrm_uf_field',
331 'entity' => 'UFField',
332 'bao' => 'CRM_Core_BAO_UFField',
336 'name' => 'is_searchable',
337 'type' => CRM_Utils_Type
::T_BOOLEAN
,
338 'title' => ts('Profile Field Is Searchable'),
339 'description' => ts('Is this field included search form of profile?'),
341 'table_name' => 'civicrm_uf_field',
342 'entity' => 'UFField',
343 'bao' => 'CRM_Core_BAO_UFField',
346 'location_type_id' => [
347 'name' => 'location_type_id',
348 'type' => CRM_Utils_Type
::T_INT
,
349 'title' => ts('Profile Field Location Type'),
350 'description' => ts('Location type of this mapping, if required'),
351 'table_name' => 'civicrm_uf_field',
352 'entity' => 'UFField',
353 'bao' => 'CRM_Core_BAO_UFField',
355 'FKClassName' => 'CRM_Core_DAO_LocationType',
358 'name' => 'phone_type_id',
359 'type' => CRM_Utils_Type
::T_INT
,
360 'title' => ts('Profile Field Phone Type'),
361 'description' => ts('Phone Type Id, if required'),
362 'table_name' => 'civicrm_uf_field',
363 'entity' => 'UFField',
364 'bao' => 'CRM_Core_BAO_UFField',
366 'pseudoconstant' => [
367 'optionGroupName' => 'phone_type',
368 'optionEditPath' => 'civicrm/admin/options/phone_type',
371 'website_type_id' => [
372 'name' => 'website_type_id',
373 'type' => CRM_Utils_Type
::T_INT
,
374 'title' => ts('Profile Field Website Type'),
375 'description' => ts('Website Type Id, if required'),
376 'table_name' => 'civicrm_uf_field',
377 'entity' => 'UFField',
378 'bao' => 'CRM_Core_BAO_UFField',
380 'pseudoconstant' => [
381 'optionGroupName' => 'website_type',
382 'optionEditPath' => 'civicrm/admin/options/website_type',
387 'type' => CRM_Utils_Type
::T_STRING
,
388 'title' => ts('Profile Field Label'),
389 'description' => ts('To save label for fields.'),
392 'size' => CRM_Utils_Type
::HUGE
,
393 'table_name' => 'civicrm_uf_field',
394 'entity' => 'UFField',
395 'bao' => 'CRM_Core_BAO_UFField',
399 'name' => 'field_type',
400 'type' => CRM_Utils_Type
::T_STRING
,
401 'title' => ts('Profile Field Type'),
402 'description' => ts('This field saves field type (ie individual,household.. field etc).'),
404 'size' => CRM_Utils_Type
::HUGE
,
405 'table_name' => 'civicrm_uf_field',
406 'entity' => 'UFField',
407 'bao' => 'CRM_Core_BAO_UFField',
411 'name' => 'is_reserved',
412 'type' => CRM_Utils_Type
::T_BOOLEAN
,
413 'title' => ts('Profile Field Is Reserved'),
414 'description' => ts('Is this field reserved for use by some other CiviCRM functionality?'),
415 'table_name' => 'civicrm_uf_field',
416 'entity' => 'UFField',
417 'bao' => 'CRM_Core_BAO_UFField',
420 'is_multi_summary' => [
421 'name' => 'is_multi_summary',
422 'type' => CRM_Utils_Type
::T_BOOLEAN
,
423 'title' => ts('Profile Field Supports Multiple'),
424 'description' => ts('Include in multi-record listing?'),
426 'table_name' => 'civicrm_uf_field',
427 'entity' => 'UFField',
428 'bao' => 'CRM_Core_BAO_UFField',
432 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
434 return Civi
::$statics[__CLASS__
]['fields'];
438 * Return a mapping from field-name to the corresponding key (as used in fields()).
441 * Array(string $name => string $uniqueName).
443 public static function &fieldKeys() {
444 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
445 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
447 return Civi
::$statics[__CLASS__
]['fieldKeys'];
451 * Returns the names of this table
455 public static function getTableName() {
456 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
460 * Returns if this table needs to be logged
464 public function getLog() {
469 * Returns the list of fields that can be imported
471 * @param bool $prefix
475 public static function &import($prefix = FALSE) {
476 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_field', $prefix, []);
481 * Returns the list of fields that can be exported
483 * @param bool $prefix
487 public static function &export($prefix = FALSE) {
488 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_field', $prefix, []);
493 * Returns the list of indices
495 * @param bool $localize
499 public static function indices($localize = TRUE) {
501 'IX_website_type_id' => [
502 'name' => 'IX_website_type_id',
504 0 => 'website_type_id',
506 'localizable' => FALSE,
507 'sig' => 'civicrm_uf_field::0::website_type_id',
510 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;