function LanguageItem::onChange
Parameters
$property_name: The name of the property.
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 98 
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.
