public function LanguageItem::onChange in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php \Drupal\Core\Field\Plugin\Field\FieldType\LanguageItem::onChange()
Parameters
bool $notify: (optional) Whether to forward the notification to the parent. Defaults to TRUE. By passing FALSE, overrides of this method can re-use the logic of parent classes without triggering notification.
Overrides Map::onChange
File
- core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ LanguageItem.php, line 114 - Contains \Drupal\Core\Field\Plugin\Field\FieldType\LanguageItem.
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);
}