public function TextItemBase::onChange in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php \Drupal\text\Plugin\Field\FieldType\TextItemBase::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/
modules/ text/ src/ Plugin/ Field/ FieldType/ TextItemBase.php, line 62 - Contains \Drupal\text\Plugin\Field\FieldType\TextItemBase.
Class
- TextItemBase
- Base class for 'text' configurable field types.
Namespace
Drupal\text\Plugin\Field\FieldTypeCode
public function onChange($property_name, $notify = TRUE) {
// Unset processed properties that are affected by the change.
foreach ($this->definition
->getPropertyDefinitions() as $property => $definition) {
if ($definition
->getClass() == '\\Drupal\\text\\TextProcessed') {
if ($property_name == 'format' || $definition
->getSetting('text source') == $property_name) {
$this
->writePropertyValue($property, NULL);
}
}
}
parent::onChange($property_name, $notify);
}