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:1c306561fedcaf68fb7d1c78756edf2e)
13 * Database access object for the UFField entity.
15 class CRM_Core_DAO_UFField
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.1';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_uf_field';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
41 * Which form does this field belong to.
48 * Name for CiviCRM field which is being exposed for sharing.
55 * Is this field currently shareable? If false, hide the field for all sharing contexts.
62 * the field is view only and not editable in user forms.
69 * Is this field required when included in a user or registration form?
76 * Controls field display order when user framework fields are displayed in registration and account editing forms.
83 * Description and/or help text to display after this field.
90 * Description and/or help text to display before this field.
97 * In what context(s) is this field visible.
104 * Is this field included as a column in the selector table?
111 * Is this field included search form of profile?
115 public $is_searchable;
118 * Location type of this mapping, if required
122 public $location_type_id;
125 * Phone Type Id, if required
129 public $phone_type_id;
132 * Website Type Id, if required
136 public $website_type_id;
139 * To save label for fields.
146 * This field saves field type (ie individual,household.. field etc).
153 * Is this field reserved for use by some other CiviCRM functionality?
160 * Include in multi-record listing?
164 public $is_multi_summary;
169 public function __construct() {
170 $this->__table
= 'civicrm_uf_field';
171 parent
::__construct();
175 * Returns localized title of this entity.
177 * @param bool $plural
178 * Whether to return the plural version of the title.
180 public static function getEntityTitle($plural = FALSE) {
181 return $plural ?
ts('UFFields') : ts('UFField');
185 * Returns foreign keys and entity references.
188 * [CRM_Core_Reference_Interface]
190 public static function getReferenceColumns() {
191 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
192 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
193 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'uf_group_id', 'civicrm_uf_group', 'id');
194 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'location_type_id', 'civicrm_location_type', 'id');
195 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
197 return Civi
::$statics[__CLASS__
]['links'];
201 * Returns all the column names of this table
205 public static function &fields() {
206 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
207 Civi
::$statics[__CLASS__
]['fields'] = [
210 'type' => CRM_Utils_Type
::T_INT
,
211 'title' => ts('Profile Field ID'),
212 'description' => ts('Unique table ID'),
214 'where' => 'civicrm_uf_field.id',
215 'table_name' => 'civicrm_uf_field',
216 'entity' => 'UFField',
217 'bao' => 'CRM_Core_BAO_UFField',
222 'name' => 'uf_group_id',
223 'type' => CRM_Utils_Type
::T_INT
,
224 'title' => ts('Profile ID'),
225 'description' => ts('Which form does this field belong to.'),
227 'where' => 'civicrm_uf_field.uf_group_id',
228 'table_name' => 'civicrm_uf_field',
229 'entity' => 'UFField',
230 'bao' => 'CRM_Core_BAO_UFField',
232 'FKClassName' => 'CRM_Core_DAO_UFGroup',
236 'pseudoconstant' => [
237 'table' => 'civicrm_uf_group',
239 'labelColumn' => 'title',
244 'name' => 'field_name',
245 'type' => CRM_Utils_Type
::T_STRING
,
246 'title' => ts('Profile Field Name'),
247 'description' => ts('Name for CiviCRM field which is being exposed for sharing.'),
250 'size' => CRM_Utils_Type
::BIG
,
251 'where' => 'civicrm_uf_field.field_name',
252 'table_name' => 'civicrm_uf_field',
253 'entity' => 'UFField',
254 'bao' => 'CRM_Core_BAO_UFField',
256 'pseudoconstant' => [
257 'callback' => 'CRM_Core_BAO_UFField::getAvailableFieldTitles',
262 'name' => 'is_active',
263 'type' => CRM_Utils_Type
::T_BOOLEAN
,
264 'title' => ts('Profile Field Is Active'),
265 'description' => ts('Is this field currently shareable? If false, hide the field for all sharing contexts.'),
266 'where' => 'civicrm_uf_field.is_active',
268 'table_name' => 'civicrm_uf_field',
269 'entity' => 'UFField',
270 'bao' => 'CRM_Core_BAO_UFField',
276 'type' => CRM_Utils_Type
::T_BOOLEAN
,
277 'title' => ts('Profile Is View Only'),
278 'description' => ts('the field is view only and not editable in user forms.'),
279 'where' => 'civicrm_uf_field.is_view',
281 'table_name' => 'civicrm_uf_field',
282 'entity' => 'UFField',
283 'bao' => 'CRM_Core_BAO_UFField',
288 'name' => 'is_required',
289 'type' => CRM_Utils_Type
::T_BOOLEAN
,
290 'title' => ts('Profile Field Is Required'),
291 'description' => ts('Is this field required when included in a user or registration form?'),
292 'where' => 'civicrm_uf_field.is_required',
294 'table_name' => 'civicrm_uf_field',
295 'entity' => 'UFField',
296 'bao' => 'CRM_Core_BAO_UFField',
302 'type' => CRM_Utils_Type
::T_INT
,
303 'title' => ts('Order'),
304 'description' => ts('Controls field display order when user framework fields are displayed in registration and account editing forms.'),
306 'where' => 'civicrm_uf_field.weight',
308 'table_name' => 'civicrm_uf_field',
309 'entity' => 'UFField',
310 'bao' => 'CRM_Core_BAO_UFField',
315 'name' => 'help_post',
316 'type' => CRM_Utils_Type
::T_TEXT
,
317 'title' => ts('Profile Field Post Help'),
318 'description' => ts('Description and/or help text to display after this field.'),
319 'where' => 'civicrm_uf_field.help_post',
320 'table_name' => 'civicrm_uf_field',
321 'entity' => 'UFField',
322 'bao' => 'CRM_Core_BAO_UFField',
327 'name' => 'help_pre',
328 'type' => CRM_Utils_Type
::T_TEXT
,
329 'title' => ts('Profile Field Pre Help'),
330 'description' => ts('Description and/or help text to display before this field.'),
331 'where' => 'civicrm_uf_field.help_pre',
332 'table_name' => 'civicrm_uf_field',
333 'entity' => 'UFField',
334 'bao' => 'CRM_Core_BAO_UFField',
339 'name' => 'visibility',
340 'type' => CRM_Utils_Type
::T_STRING
,
341 'title' => ts('Profile Field Visibility'),
342 'description' => ts('In what context(s) is this field visible.'),
344 'size' => CRM_Utils_Type
::MEDIUM
,
345 'where' => 'civicrm_uf_field.visibility',
346 'default' => 'User and User Admin Only',
347 'table_name' => 'civicrm_uf_field',
348 'entity' => 'UFField',
349 'bao' => 'CRM_Core_BAO_UFField',
354 'pseudoconstant' => [
355 'callback' => 'CRM_Core_SelectValues::ufVisibility',
360 'name' => 'in_selector',
361 'type' => CRM_Utils_Type
::T_BOOLEAN
,
362 'title' => ts('Profile Field Is a Filter'),
363 'description' => ts('Is this field included as a column in the selector table?'),
364 'where' => 'civicrm_uf_field.in_selector',
366 'table_name' => 'civicrm_uf_field',
367 'entity' => 'UFField',
368 'bao' => 'CRM_Core_BAO_UFField',
373 'name' => 'is_searchable',
374 'type' => CRM_Utils_Type
::T_BOOLEAN
,
375 'title' => ts('Profile Field Is Searchable'),
376 'description' => ts('Is this field included search form of profile?'),
377 'where' => 'civicrm_uf_field.is_searchable',
379 'table_name' => 'civicrm_uf_field',
380 'entity' => 'UFField',
381 'bao' => 'CRM_Core_BAO_UFField',
385 'location_type_id' => [
386 'name' => 'location_type_id',
387 'type' => CRM_Utils_Type
::T_INT
,
388 'title' => ts('Profile Field Location Type'),
389 'description' => ts('Location type of this mapping, if required'),
390 'where' => 'civicrm_uf_field.location_type_id',
391 'table_name' => 'civicrm_uf_field',
392 'entity' => 'UFField',
393 'bao' => 'CRM_Core_BAO_UFField',
395 'FKClassName' => 'CRM_Core_DAO_LocationType',
399 'name' => 'phone_type_id',
400 'type' => CRM_Utils_Type
::T_INT
,
401 'title' => ts('Profile Field Phone Type'),
402 'description' => ts('Phone Type Id, if required'),
403 'where' => 'civicrm_uf_field.phone_type_id',
404 'table_name' => 'civicrm_uf_field',
405 'entity' => 'UFField',
406 'bao' => 'CRM_Core_BAO_UFField',
408 'pseudoconstant' => [
409 'optionGroupName' => 'phone_type',
410 'optionEditPath' => 'civicrm/admin/options/phone_type',
414 'website_type_id' => [
415 'name' => 'website_type_id',
416 'type' => CRM_Utils_Type
::T_INT
,
417 'title' => ts('Profile Field Website Type'),
418 'description' => ts('Website Type Id, if required'),
419 'where' => 'civicrm_uf_field.website_type_id',
420 'table_name' => 'civicrm_uf_field',
421 'entity' => 'UFField',
422 'bao' => 'CRM_Core_BAO_UFField',
424 'pseudoconstant' => [
425 'optionGroupName' => 'website_type',
426 'optionEditPath' => 'civicrm/admin/options/website_type',
432 'type' => CRM_Utils_Type
::T_STRING
,
433 'title' => ts('Profile Field Label'),
434 'description' => ts('To save label for fields.'),
437 'size' => CRM_Utils_Type
::HUGE
,
438 'where' => 'civicrm_uf_field.label',
439 'table_name' => 'civicrm_uf_field',
440 'entity' => 'UFField',
441 'bao' => 'CRM_Core_BAO_UFField',
446 'name' => 'field_type',
447 'type' => CRM_Utils_Type
::T_STRING
,
448 'title' => ts('Profile Field Type'),
449 'description' => ts('This field saves field type (ie individual,household.. field etc).'),
451 'size' => CRM_Utils_Type
::HUGE
,
452 'where' => 'civicrm_uf_field.field_type',
453 'table_name' => 'civicrm_uf_field',
454 'entity' => 'UFField',
455 'bao' => 'CRM_Core_BAO_UFField',
460 'name' => 'is_reserved',
461 'type' => CRM_Utils_Type
::T_BOOLEAN
,
462 'title' => ts('Profile Field Is Reserved'),
463 'description' => ts('Is this field reserved for use by some other CiviCRM functionality?'),
464 'where' => 'civicrm_uf_field.is_reserved',
465 'table_name' => 'civicrm_uf_field',
466 'entity' => 'UFField',
467 'bao' => 'CRM_Core_BAO_UFField',
471 'is_multi_summary' => [
472 'name' => 'is_multi_summary',
473 'type' => CRM_Utils_Type
::T_BOOLEAN
,
474 'title' => ts('Profile Field Supports Multiple'),
475 'description' => ts('Include in multi-record listing?'),
476 'where' => 'civicrm_uf_field.is_multi_summary',
478 'table_name' => 'civicrm_uf_field',
479 'entity' => 'UFField',
480 'bao' => 'CRM_Core_BAO_UFField',
485 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
487 return Civi
::$statics[__CLASS__
]['fields'];
491 * Return a mapping from field-name to the corresponding key (as used in fields()).
494 * Array(string $name => string $uniqueName).
496 public static function &fieldKeys() {
497 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
498 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
500 return Civi
::$statics[__CLASS__
]['fieldKeys'];
504 * Returns the names of this table
508 public static function getTableName() {
509 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
513 * Returns if this table needs to be logged
517 public function getLog() {
522 * Returns the list of fields that can be imported
524 * @param bool $prefix
528 public static function &import($prefix = FALSE) {
529 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_field', $prefix, []);
534 * Returns the list of fields that can be exported
536 * @param bool $prefix
540 public static function &export($prefix = FALSE) {
541 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_field', $prefix, []);
546 * Returns the list of indices
548 * @param bool $localize
552 public static function indices($localize = TRUE) {
554 'IX_website_type_id' => [
555 'name' => 'IX_website_type_id',
557 0 => 'website_type_id',
559 'localizable' => FALSE,
560 'sig' => 'civicrm_uf_field::0::website_type_id',
563 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;