function LanguageItem::applyDefaultValue
Same name in other branches
- 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php \Drupal\Core\Field\Plugin\Field\FieldType\LanguageItem::applyDefaultValue()
- 8.9.x core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php \Drupal\Core\Field\Plugin\Field\FieldType\LanguageItem::applyDefaultValue()
- 11.x core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php \Drupal\Core\Field\Plugin\Field\FieldType\LanguageItem::applyDefaultValue()
Overrides Map::applyDefaultValue
1 method overrides LanguageItem::applyDefaultValue()
- DefaultLanguageItem::applyDefaultValue in core/
modules/ language/ src/ DefaultLanguageItem.php - Applies the default value.
File
-
core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ LanguageItem.php, line 89
Class
- LanguageItem
- Defines the 'language' entity field item.
Namespace
Drupal\Core\Field\Plugin\Field\FieldTypeCode
public function applyDefaultValue($notify = TRUE) {
// Default to the site's default language. When language module is enabled,
// this behavior is configurable, see language_field_info_alter().
$this->setValue([
'value' => \Drupal::languageManager()->getDefaultLanguage()
->getId(),
], $notify);
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.