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:c73a4661d33e4dde2240d6d8ac7fd2c4)
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 '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',
239 'pseudoconstant' => [
240 'callback' => 'CRM_Core_BAO_UFField::getAvailableFieldTitles',
244 'name' => 'is_active',
245 'type' => CRM_Utils_Type
::T_BOOLEAN
,
246 'title' => ts('Profile Field Is Active'),
247 'description' => ts('Is this field currently shareable? If false, hide the field for all sharing contexts.'),
249 'table_name' => 'civicrm_uf_field',
250 'entity' => 'UFField',
251 'bao' => 'CRM_Core_BAO_UFField',
256 'type' => CRM_Utils_Type
::T_BOOLEAN
,
257 'title' => ts('Profile Is View Only'),
258 'description' => ts('the field is view only and not editable in user forms.'),
260 'table_name' => 'civicrm_uf_field',
261 'entity' => 'UFField',
262 'bao' => 'CRM_Core_BAO_UFField',
266 'name' => 'is_required',
267 'type' => CRM_Utils_Type
::T_BOOLEAN
,
268 'title' => ts('Profile Field Is Required'),
269 'description' => ts('Is this field required when included in a user or registration form?'),
271 'table_name' => 'civicrm_uf_field',
272 'entity' => 'UFField',
273 'bao' => 'CRM_Core_BAO_UFField',
278 'type' => CRM_Utils_Type
::T_INT
,
279 'title' => ts('Order'),
280 'description' => ts('Controls field display order when user framework fields are displayed in registration and account editing forms.'),
283 'table_name' => 'civicrm_uf_field',
284 'entity' => 'UFField',
285 'bao' => 'CRM_Core_BAO_UFField',
289 'name' => 'help_post',
290 'type' => CRM_Utils_Type
::T_TEXT
,
291 'title' => ts('Profile Field Post Help'),
292 'description' => ts('Description and/or help text to display after this field.'),
293 'table_name' => 'civicrm_uf_field',
294 'entity' => 'UFField',
295 'bao' => 'CRM_Core_BAO_UFField',
299 'name' => 'help_pre',
300 'type' => CRM_Utils_Type
::T_TEXT
,
301 'title' => ts('Profile Field Pre Help'),
302 'description' => ts('Description and/or help text to display before this field.'),
303 'table_name' => 'civicrm_uf_field',
304 'entity' => 'UFField',
305 'bao' => 'CRM_Core_BAO_UFField',
309 'name' => 'visibility',
310 'type' => CRM_Utils_Type
::T_STRING
,
311 'title' => ts('Profile Field Visibility'),
312 'description' => ts('In what context(s) is this field visible.'),
314 'size' => CRM_Utils_Type
::MEDIUM
,
315 'default' => 'User and User Admin Only',
316 'table_name' => 'civicrm_uf_field',
317 'entity' => 'UFField',
318 'bao' => 'CRM_Core_BAO_UFField',
323 'pseudoconstant' => [
324 'callback' => 'CRM_Core_SelectValues::ufVisibility',
328 'name' => 'in_selector',
329 'type' => CRM_Utils_Type
::T_BOOLEAN
,
330 'title' => ts('Profile Field Is a Filter'),
331 'description' => ts('Is this field included as a column in the selector table?'),
333 'table_name' => 'civicrm_uf_field',
334 'entity' => 'UFField',
335 'bao' => 'CRM_Core_BAO_UFField',
339 'name' => 'is_searchable',
340 'type' => CRM_Utils_Type
::T_BOOLEAN
,
341 'title' => ts('Profile Field Is Searchable'),
342 'description' => ts('Is this field included search form of profile?'),
344 'table_name' => 'civicrm_uf_field',
345 'entity' => 'UFField',
346 'bao' => 'CRM_Core_BAO_UFField',
349 'location_type_id' => [
350 'name' => 'location_type_id',
351 'type' => CRM_Utils_Type
::T_INT
,
352 'title' => ts('Profile Field Location Type'),
353 'description' => ts('Location type of this mapping, if required'),
354 'table_name' => 'civicrm_uf_field',
355 'entity' => 'UFField',
356 'bao' => 'CRM_Core_BAO_UFField',
358 'FKClassName' => 'CRM_Core_DAO_LocationType',
361 'name' => 'phone_type_id',
362 'type' => CRM_Utils_Type
::T_INT
,
363 'title' => ts('Profile Field Phone Type'),
364 'description' => ts('Phone Type Id, if required'),
365 'table_name' => 'civicrm_uf_field',
366 'entity' => 'UFField',
367 'bao' => 'CRM_Core_BAO_UFField',
369 'pseudoconstant' => [
370 'optionGroupName' => 'phone_type',
371 'optionEditPath' => 'civicrm/admin/options/phone_type',
374 'website_type_id' => [
375 'name' => 'website_type_id',
376 'type' => CRM_Utils_Type
::T_INT
,
377 'title' => ts('Profile Field Website Type'),
378 'description' => ts('Website Type Id, if required'),
379 'table_name' => 'civicrm_uf_field',
380 'entity' => 'UFField',
381 'bao' => 'CRM_Core_BAO_UFField',
383 'pseudoconstant' => [
384 'optionGroupName' => 'website_type',
385 'optionEditPath' => 'civicrm/admin/options/website_type',
390 'type' => CRM_Utils_Type
::T_STRING
,
391 'title' => ts('Profile Field Label'),
392 'description' => ts('To save label for fields.'),
395 'size' => CRM_Utils_Type
::HUGE
,
396 'table_name' => 'civicrm_uf_field',
397 'entity' => 'UFField',
398 'bao' => 'CRM_Core_BAO_UFField',
402 'name' => 'field_type',
403 'type' => CRM_Utils_Type
::T_STRING
,
404 'title' => ts('Profile Field Type'),
405 'description' => ts('This field saves field type (ie individual,household.. field etc).'),
407 'size' => CRM_Utils_Type
::HUGE
,
408 'table_name' => 'civicrm_uf_field',
409 'entity' => 'UFField',
410 'bao' => 'CRM_Core_BAO_UFField',
414 'name' => 'is_reserved',
415 'type' => CRM_Utils_Type
::T_BOOLEAN
,
416 'title' => ts('Profile Field Is Reserved'),
417 'description' => ts('Is this field reserved for use by some other CiviCRM functionality?'),
418 'table_name' => 'civicrm_uf_field',
419 'entity' => 'UFField',
420 'bao' => 'CRM_Core_BAO_UFField',
423 'is_multi_summary' => [
424 'name' => 'is_multi_summary',
425 'type' => CRM_Utils_Type
::T_BOOLEAN
,
426 'title' => ts('Profile Field Supports Multiple'),
427 'description' => ts('Include in multi-record listing?'),
429 'table_name' => 'civicrm_uf_field',
430 'entity' => 'UFField',
431 'bao' => 'CRM_Core_BAO_UFField',
435 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
437 return Civi
::$statics[__CLASS__
]['fields'];
441 * Return a mapping from field-name to the corresponding key (as used in fields()).
444 * Array(string $name => string $uniqueName).
446 public static function &fieldKeys() {
447 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
448 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
450 return Civi
::$statics[__CLASS__
]['fieldKeys'];
454 * Returns the names of this table
458 public static function getTableName() {
459 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
463 * Returns if this table needs to be logged
467 public function getLog() {
472 * Returns the list of fields that can be imported
474 * @param bool $prefix
478 public static function &import($prefix = FALSE) {
479 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_field', $prefix, []);
484 * Returns the list of fields that can be exported
486 * @param bool $prefix
490 public static function &export($prefix = FALSE) {
491 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_field', $prefix, []);
496 * Returns the list of indices
498 * @param bool $localize
502 public static function indices($localize = TRUE) {
504 'IX_website_type_id' => [
505 'name' => 'IX_website_type_id',
507 0 => 'website_type_id',
509 'localizable' => FALSE,
510 'sig' => 'civicrm_uf_field::0::website_type_id',
513 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;