function LanguageItem::onChange
Same name in other branches
- 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php \Drupal\Core\Field\Plugin\Field\FieldType\LanguageItem::onChange()
- 8.9.x core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php \Drupal\Core\Field\Plugin\Field\FieldType\LanguageItem::onChange()
- 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php \Drupal\Core\Field\Plugin\Field\FieldType\LanguageItem::onChange()
Overrides Map::onChange
File
-
core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ LanguageItem.php, line 99
Class
- LanguageItem
- Defines the 'language' entity field item.
Namespace
Drupal\Core\Field\Plugin\Field\FieldTypeCode
public function onChange($property_name, $notify = TRUE) {
// Make sure that the value and the language property stay in sync.
if ($property_name == 'value') {
$this->writePropertyValue('language', $this->value);
}
elseif ($property_name == 'language') {
$this->writePropertyValue('value', $this->get('language')
->getTargetIdentifier());
}
parent::onChange($property_name, $notify);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.