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:a77a2bfe4b288e20b6929fd3a7532850)
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 localized title of this entity.
175 public static function getEntityTitle() {
176 return ts('UFFields');
180 * Returns foreign keys and entity references.
183 * [CRM_Core_Reference_Interface]
185 public static function getReferenceColumns() {
186 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
187 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
188 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'uf_group_id', 'civicrm_uf_group', 'id');
189 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'location_type_id', 'civicrm_location_type', 'id');
190 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
192 return Civi
::$statics[__CLASS__
]['links'];
196 * Returns all the column names of this table
200 public static function &fields() {
201 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
202 Civi
::$statics[__CLASS__
]['fields'] = [
205 'type' => CRM_Utils_Type
::T_INT
,
206 'title' => ts('Profile Field ID'),
207 'description' => ts('Unique table ID'),
209 'where' => 'civicrm_uf_field.id',
210 'table_name' => 'civicrm_uf_field',
211 'entity' => 'UFField',
212 'bao' => 'CRM_Core_BAO_UFField',
217 'name' => 'uf_group_id',
218 'type' => CRM_Utils_Type
::T_INT
,
219 'title' => ts('Profile ID'),
220 'description' => ts('Which form does this field belong to.'),
222 'where' => 'civicrm_uf_field.uf_group_id',
223 'table_name' => 'civicrm_uf_field',
224 'entity' => 'UFField',
225 'bao' => 'CRM_Core_BAO_UFField',
227 'FKClassName' => 'CRM_Core_DAO_UFGroup',
231 'pseudoconstant' => [
232 'table' => 'civicrm_uf_group',
234 'labelColumn' => 'title',
239 'name' => 'field_name',
240 'type' => CRM_Utils_Type
::T_STRING
,
241 'title' => ts('Profile Field Name'),
242 'description' => ts('Name for CiviCRM field which is being exposed for sharing.'),
245 'size' => CRM_Utils_Type
::BIG
,
246 'where' => 'civicrm_uf_field.field_name',
247 'table_name' => 'civicrm_uf_field',
248 'entity' => 'UFField',
249 'bao' => 'CRM_Core_BAO_UFField',
251 'pseudoconstant' => [
252 'callback' => 'CRM_Core_BAO_UFField::getAvailableFieldTitles',
257 'name' => 'is_active',
258 'type' => CRM_Utils_Type
::T_BOOLEAN
,
259 'title' => ts('Profile Field Is Active'),
260 'description' => ts('Is this field currently shareable? If false, hide the field for all sharing contexts.'),
261 'where' => 'civicrm_uf_field.is_active',
263 'table_name' => 'civicrm_uf_field',
264 'entity' => 'UFField',
265 'bao' => 'CRM_Core_BAO_UFField',
271 'type' => CRM_Utils_Type
::T_BOOLEAN
,
272 'title' => ts('Profile Is View Only'),
273 'description' => ts('the field is view only and not editable in user forms.'),
274 'where' => 'civicrm_uf_field.is_view',
276 'table_name' => 'civicrm_uf_field',
277 'entity' => 'UFField',
278 'bao' => 'CRM_Core_BAO_UFField',
283 'name' => 'is_required',
284 'type' => CRM_Utils_Type
::T_BOOLEAN
,
285 'title' => ts('Profile Field Is Required'),
286 'description' => ts('Is this field required when included in a user or registration form?'),
287 'where' => 'civicrm_uf_field.is_required',
289 'table_name' => 'civicrm_uf_field',
290 'entity' => 'UFField',
291 'bao' => 'CRM_Core_BAO_UFField',
297 'type' => CRM_Utils_Type
::T_INT
,
298 'title' => ts('Order'),
299 'description' => ts('Controls field display order when user framework fields are displayed in registration and account editing forms.'),
301 'where' => 'civicrm_uf_field.weight',
303 'table_name' => 'civicrm_uf_field',
304 'entity' => 'UFField',
305 'bao' => 'CRM_Core_BAO_UFField',
310 'name' => 'help_post',
311 'type' => CRM_Utils_Type
::T_TEXT
,
312 'title' => ts('Profile Field Post Help'),
313 'description' => ts('Description and/or help text to display after this field.'),
314 'where' => 'civicrm_uf_field.help_post',
315 'table_name' => 'civicrm_uf_field',
316 'entity' => 'UFField',
317 'bao' => 'CRM_Core_BAO_UFField',
322 'name' => 'help_pre',
323 'type' => CRM_Utils_Type
::T_TEXT
,
324 'title' => ts('Profile Field Pre Help'),
325 'description' => ts('Description and/or help text to display before this field.'),
326 'where' => 'civicrm_uf_field.help_pre',
327 'table_name' => 'civicrm_uf_field',
328 'entity' => 'UFField',
329 'bao' => 'CRM_Core_BAO_UFField',
334 'name' => 'visibility',
335 'type' => CRM_Utils_Type
::T_STRING
,
336 'title' => ts('Profile Field Visibility'),
337 'description' => ts('In what context(s) is this field visible.'),
339 'size' => CRM_Utils_Type
::MEDIUM
,
340 'where' => 'civicrm_uf_field.visibility',
341 'default' => 'User and User Admin Only',
342 'table_name' => 'civicrm_uf_field',
343 'entity' => 'UFField',
344 'bao' => 'CRM_Core_BAO_UFField',
349 'pseudoconstant' => [
350 'callback' => 'CRM_Core_SelectValues::ufVisibility',
355 'name' => 'in_selector',
356 'type' => CRM_Utils_Type
::T_BOOLEAN
,
357 'title' => ts('Profile Field Is a Filter'),
358 'description' => ts('Is this field included as a column in the selector table?'),
359 'where' => 'civicrm_uf_field.in_selector',
361 'table_name' => 'civicrm_uf_field',
362 'entity' => 'UFField',
363 'bao' => 'CRM_Core_BAO_UFField',
368 'name' => 'is_searchable',
369 'type' => CRM_Utils_Type
::T_BOOLEAN
,
370 'title' => ts('Profile Field Is Searchable'),
371 'description' => ts('Is this field included search form of profile?'),
372 'where' => 'civicrm_uf_field.is_searchable',
374 'table_name' => 'civicrm_uf_field',
375 'entity' => 'UFField',
376 'bao' => 'CRM_Core_BAO_UFField',
380 'location_type_id' => [
381 'name' => 'location_type_id',
382 'type' => CRM_Utils_Type
::T_INT
,
383 'title' => ts('Profile Field Location Type'),
384 'description' => ts('Location type of this mapping, if required'),
385 'where' => 'civicrm_uf_field.location_type_id',
386 'table_name' => 'civicrm_uf_field',
387 'entity' => 'UFField',
388 'bao' => 'CRM_Core_BAO_UFField',
390 'FKClassName' => 'CRM_Core_DAO_LocationType',
394 'name' => 'phone_type_id',
395 'type' => CRM_Utils_Type
::T_INT
,
396 'title' => ts('Profile Field Phone Type'),
397 'description' => ts('Phone Type Id, if required'),
398 'where' => 'civicrm_uf_field.phone_type_id',
399 'table_name' => 'civicrm_uf_field',
400 'entity' => 'UFField',
401 'bao' => 'CRM_Core_BAO_UFField',
403 'pseudoconstant' => [
404 'optionGroupName' => 'phone_type',
405 'optionEditPath' => 'civicrm/admin/options/phone_type',
409 'website_type_id' => [
410 'name' => 'website_type_id',
411 'type' => CRM_Utils_Type
::T_INT
,
412 'title' => ts('Profile Field Website Type'),
413 'description' => ts('Website Type Id, if required'),
414 'where' => 'civicrm_uf_field.website_type_id',
415 'table_name' => 'civicrm_uf_field',
416 'entity' => 'UFField',
417 'bao' => 'CRM_Core_BAO_UFField',
419 'pseudoconstant' => [
420 'optionGroupName' => 'website_type',
421 'optionEditPath' => 'civicrm/admin/options/website_type',
427 'type' => CRM_Utils_Type
::T_STRING
,
428 'title' => ts('Profile Field Label'),
429 'description' => ts('To save label for fields.'),
432 'size' => CRM_Utils_Type
::HUGE
,
433 'where' => 'civicrm_uf_field.label',
434 'table_name' => 'civicrm_uf_field',
435 'entity' => 'UFField',
436 'bao' => 'CRM_Core_BAO_UFField',
441 'name' => 'field_type',
442 'type' => CRM_Utils_Type
::T_STRING
,
443 'title' => ts('Profile Field Type'),
444 'description' => ts('This field saves field type (ie individual,household.. field etc).'),
446 'size' => CRM_Utils_Type
::HUGE
,
447 'where' => 'civicrm_uf_field.field_type',
448 'table_name' => 'civicrm_uf_field',
449 'entity' => 'UFField',
450 'bao' => 'CRM_Core_BAO_UFField',
455 'name' => 'is_reserved',
456 'type' => CRM_Utils_Type
::T_BOOLEAN
,
457 'title' => ts('Profile Field Is Reserved'),
458 'description' => ts('Is this field reserved for use by some other CiviCRM functionality?'),
459 'where' => 'civicrm_uf_field.is_reserved',
460 'table_name' => 'civicrm_uf_field',
461 'entity' => 'UFField',
462 'bao' => 'CRM_Core_BAO_UFField',
466 'is_multi_summary' => [
467 'name' => 'is_multi_summary',
468 'type' => CRM_Utils_Type
::T_BOOLEAN
,
469 'title' => ts('Profile Field Supports Multiple'),
470 'description' => ts('Include in multi-record listing?'),
471 'where' => 'civicrm_uf_field.is_multi_summary',
473 'table_name' => 'civicrm_uf_field',
474 'entity' => 'UFField',
475 'bao' => 'CRM_Core_BAO_UFField',
480 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
482 return Civi
::$statics[__CLASS__
]['fields'];
486 * Return a mapping from field-name to the corresponding key (as used in fields()).
489 * Array(string $name => string $uniqueName).
491 public static function &fieldKeys() {
492 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
493 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
495 return Civi
::$statics[__CLASS__
]['fieldKeys'];
499 * Returns the names of this table
503 public static function getTableName() {
504 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
508 * Returns if this table needs to be logged
512 public function getLog() {
517 * Returns the list of fields that can be imported
519 * @param bool $prefix
523 public static function &import($prefix = FALSE) {
524 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_field', $prefix, []);
529 * Returns the list of fields that can be exported
531 * @param bool $prefix
535 public static function &export($prefix = FALSE) {
536 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_field', $prefix, []);
541 * Returns the list of indices
543 * @param bool $localize
547 public static function indices($localize = TRUE) {
549 'IX_website_type_id' => [
550 'name' => 'IX_website_type_id',
552 0 => 'website_type_id',
554 'localizable' => FALSE,
555 'sig' => 'civicrm_uf_field::0::website_type_id',
558 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;