5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/UFField.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:100fb17dc7c4289eab137e5d7dc4e71c)
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 public static $_tableName = 'civicrm_uf_field';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
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 'where' => 'civicrm_uf_field.id',
203 'table_name' => 'civicrm_uf_field',
204 'entity' => 'UFField',
205 'bao' => 'CRM_Core_BAO_UFField',
209 'name' => 'uf_group_id',
210 'type' => CRM_Utils_Type
::T_INT
,
211 'title' => ts('Profile ID'),
212 'description' => ts('Which form does this field belong to.'),
214 'where' => 'civicrm_uf_field.uf_group_id',
215 'table_name' => 'civicrm_uf_field',
216 'entity' => 'UFField',
217 'bao' => 'CRM_Core_BAO_UFField',
219 'FKClassName' => 'CRM_Core_DAO_UFGroup',
223 'pseudoconstant' => [
224 'table' => 'civicrm_uf_group',
226 'labelColumn' => 'title',
230 'name' => 'field_name',
231 'type' => CRM_Utils_Type
::T_STRING
,
232 'title' => ts('Profile Field Name'),
233 'description' => ts('Name for CiviCRM field which is being exposed for sharing.'),
236 'size' => CRM_Utils_Type
::BIG
,
237 'where' => 'civicrm_uf_field.field_name',
238 'table_name' => 'civicrm_uf_field',
239 'entity' => 'UFField',
240 'bao' => 'CRM_Core_BAO_UFField',
242 'pseudoconstant' => [
243 'callback' => 'CRM_Core_BAO_UFField::getAvailableFieldTitles',
247 'name' => 'is_active',
248 'type' => CRM_Utils_Type
::T_BOOLEAN
,
249 'title' => ts('Profile Field Is Active'),
250 'description' => ts('Is this field currently shareable? If false, hide the field for all sharing contexts.'),
251 'where' => 'civicrm_uf_field.is_active',
253 'table_name' => 'civicrm_uf_field',
254 'entity' => 'UFField',
255 'bao' => 'CRM_Core_BAO_UFField',
260 'type' => CRM_Utils_Type
::T_BOOLEAN
,
261 'title' => ts('Profile Is View Only'),
262 'description' => ts('the field is view only and not editable in user forms.'),
263 'where' => 'civicrm_uf_field.is_view',
265 'table_name' => 'civicrm_uf_field',
266 'entity' => 'UFField',
267 'bao' => 'CRM_Core_BAO_UFField',
271 'name' => 'is_required',
272 'type' => CRM_Utils_Type
::T_BOOLEAN
,
273 'title' => ts('Profile Field Is Required'),
274 'description' => ts('Is this field required when included in a user or registration form?'),
275 'where' => 'civicrm_uf_field.is_required',
277 'table_name' => 'civicrm_uf_field',
278 'entity' => 'UFField',
279 'bao' => 'CRM_Core_BAO_UFField',
284 'type' => CRM_Utils_Type
::T_INT
,
285 'title' => ts('Order'),
286 'description' => ts('Controls field display order when user framework fields are displayed in registration and account editing forms.'),
288 'where' => 'civicrm_uf_field.weight',
290 'table_name' => 'civicrm_uf_field',
291 'entity' => 'UFField',
292 'bao' => 'CRM_Core_BAO_UFField',
296 'name' => 'help_post',
297 'type' => CRM_Utils_Type
::T_TEXT
,
298 'title' => ts('Profile Field Post Help'),
299 'description' => ts('Description and/or help text to display after this field.'),
300 'where' => 'civicrm_uf_field.help_post',
301 'table_name' => 'civicrm_uf_field',
302 'entity' => 'UFField',
303 'bao' => 'CRM_Core_BAO_UFField',
307 'name' => 'help_pre',
308 'type' => CRM_Utils_Type
::T_TEXT
,
309 'title' => ts('Profile Field Pre Help'),
310 'description' => ts('Description and/or help text to display before this field.'),
311 'where' => 'civicrm_uf_field.help_pre',
312 'table_name' => 'civicrm_uf_field',
313 'entity' => 'UFField',
314 'bao' => 'CRM_Core_BAO_UFField',
318 'name' => 'visibility',
319 'type' => CRM_Utils_Type
::T_STRING
,
320 'title' => ts('Profile Field Visibility'),
321 'description' => ts('In what context(s) is this field visible.'),
323 'size' => CRM_Utils_Type
::MEDIUM
,
324 'where' => 'civicrm_uf_field.visibility',
325 'default' => 'User and User Admin Only',
326 'table_name' => 'civicrm_uf_field',
327 'entity' => 'UFField',
328 'bao' => 'CRM_Core_BAO_UFField',
333 'pseudoconstant' => [
334 'callback' => 'CRM_Core_SelectValues::ufVisibility',
338 'name' => 'in_selector',
339 'type' => CRM_Utils_Type
::T_BOOLEAN
,
340 'title' => ts('Profile Field Is a Filter'),
341 'description' => ts('Is this field included as a column in the selector table?'),
342 'where' => 'civicrm_uf_field.in_selector',
344 'table_name' => 'civicrm_uf_field',
345 'entity' => 'UFField',
346 'bao' => 'CRM_Core_BAO_UFField',
350 'name' => 'is_searchable',
351 'type' => CRM_Utils_Type
::T_BOOLEAN
,
352 'title' => ts('Profile Field Is Searchable'),
353 'description' => ts('Is this field included search form of profile?'),
354 'where' => 'civicrm_uf_field.is_searchable',
356 'table_name' => 'civicrm_uf_field',
357 'entity' => 'UFField',
358 'bao' => 'CRM_Core_BAO_UFField',
361 'location_type_id' => [
362 'name' => 'location_type_id',
363 'type' => CRM_Utils_Type
::T_INT
,
364 'title' => ts('Profile Field Location Type'),
365 'description' => ts('Location type of this mapping, if required'),
366 'where' => 'civicrm_uf_field.location_type_id',
367 'table_name' => 'civicrm_uf_field',
368 'entity' => 'UFField',
369 'bao' => 'CRM_Core_BAO_UFField',
371 'FKClassName' => 'CRM_Core_DAO_LocationType',
374 'name' => 'phone_type_id',
375 'type' => CRM_Utils_Type
::T_INT
,
376 'title' => ts('Profile Field Phone Type'),
377 'description' => ts('Phone Type Id, if required'),
378 'where' => 'civicrm_uf_field.phone_type_id',
379 'table_name' => 'civicrm_uf_field',
380 'entity' => 'UFField',
381 'bao' => 'CRM_Core_BAO_UFField',
383 'pseudoconstant' => [
384 'optionGroupName' => 'phone_type',
385 'optionEditPath' => 'civicrm/admin/options/phone_type',
388 'website_type_id' => [
389 'name' => 'website_type_id',
390 'type' => CRM_Utils_Type
::T_INT
,
391 'title' => ts('Profile Field Website Type'),
392 'description' => ts('Website Type Id, if required'),
393 'where' => 'civicrm_uf_field.website_type_id',
394 'table_name' => 'civicrm_uf_field',
395 'entity' => 'UFField',
396 'bao' => 'CRM_Core_BAO_UFField',
398 'pseudoconstant' => [
399 'optionGroupName' => 'website_type',
400 'optionEditPath' => 'civicrm/admin/options/website_type',
405 'type' => CRM_Utils_Type
::T_STRING
,
406 'title' => ts('Profile Field Label'),
407 'description' => ts('To save label for fields.'),
410 'size' => CRM_Utils_Type
::HUGE
,
411 'where' => 'civicrm_uf_field.label',
412 'table_name' => 'civicrm_uf_field',
413 'entity' => 'UFField',
414 'bao' => 'CRM_Core_BAO_UFField',
418 'name' => 'field_type',
419 'type' => CRM_Utils_Type
::T_STRING
,
420 'title' => ts('Profile Field Type'),
421 'description' => ts('This field saves field type (ie individual,household.. field etc).'),
423 'size' => CRM_Utils_Type
::HUGE
,
424 'where' => 'civicrm_uf_field.field_type',
425 'table_name' => 'civicrm_uf_field',
426 'entity' => 'UFField',
427 'bao' => 'CRM_Core_BAO_UFField',
431 'name' => 'is_reserved',
432 'type' => CRM_Utils_Type
::T_BOOLEAN
,
433 'title' => ts('Profile Field Is Reserved'),
434 'description' => ts('Is this field reserved for use by some other CiviCRM functionality?'),
435 'where' => 'civicrm_uf_field.is_reserved',
436 'table_name' => 'civicrm_uf_field',
437 'entity' => 'UFField',
438 'bao' => 'CRM_Core_BAO_UFField',
441 'is_multi_summary' => [
442 'name' => 'is_multi_summary',
443 'type' => CRM_Utils_Type
::T_BOOLEAN
,
444 'title' => ts('Profile Field Supports Multiple'),
445 'description' => ts('Include in multi-record listing?'),
446 'where' => 'civicrm_uf_field.is_multi_summary',
448 'table_name' => 'civicrm_uf_field',
449 'entity' => 'UFField',
450 'bao' => 'CRM_Core_BAO_UFField',
454 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
456 return Civi
::$statics[__CLASS__
]['fields'];
460 * Return a mapping from field-name to the corresponding key (as used in fields()).
463 * Array(string $name => string $uniqueName).
465 public static function &fieldKeys() {
466 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
467 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
469 return Civi
::$statics[__CLASS__
]['fieldKeys'];
473 * Returns the names of this table
477 public static function getTableName() {
478 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
482 * Returns if this table needs to be logged
486 public function getLog() {
491 * Returns the list of fields that can be imported
493 * @param bool $prefix
497 public static function &import($prefix = FALSE) {
498 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_field', $prefix, []);
503 * Returns the list of fields that can be exported
505 * @param bool $prefix
509 public static function &export($prefix = FALSE) {
510 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_field', $prefix, []);
515 * Returns the list of indices
517 * @param bool $localize
521 public static function indices($localize = TRUE) {
523 'IX_website_type_id' => [
524 'name' => 'IX_website_type_id',
526 0 => 'website_type_id',
528 'localizable' => FALSE,
529 'sig' => 'civicrm_uf_field::0::website_type_id',
532 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;