public static function baseFieldDefinitions(EntityTypeInterface
$entity_type) { /** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */
$fields = parent::
baseFieldDefinitions($entity_type);
$fields['uid'
]->
setLabel(t('User ID'
)) ->
setDescription(t('The user ID.'
));
$fields['uuid'
]->
setDescription(t('The user UUID.'
));
$fields['langcode'
]->
setLabel(t('Language code'
)) ->
setDescription(t('The user language code.'
)) ->
setDisplayOptions('form',
['region' => 'hidden'
]);
$fields['preferred_langcode'
] = BaseFieldDefinition::
create('language'
) ->
setLabel(t('Preferred language code'
)) ->
setDescription(t("The user's preferred language code for receiving emails and viewing the site."
)) // @todo: Define this via an options provider once
// https://www.drupal.org/node/2329937 is completed.
->
addPropertyConstraints('value',
[ 'AllowedValues' =>
['callback' => __CLASS__ . '::getAllowedConfigurableLanguageCodes'
],
]);
$fields['preferred_admin_langcode'
] = BaseFieldDefinition::
create('language'
)