public function ModerationStateFieldItemList::onChange in Drupal 10
Same name and namespace in other branches
- 8 core/modules/content_moderation/src/Plugin/Field/ModerationStateFieldItemList.php \Drupal\content_moderation\Plugin\Field\ModerationStateFieldItemList::onChange()
- 9 core/modules/content_moderation/src/Plugin/Field/ModerationStateFieldItemList.php \Drupal\content_moderation\Plugin\Field\ModerationStateFieldItemList::onChange()
React to changes to a child property or item.
Note that this is invoked after any changes have been applied.
Parameters
$name: The name of the property or the delta of the list item which is changed.
Overrides ItemList::onChange
File
- core/
modules/ content_moderation/ src/ Plugin/ Field/ ModerationStateFieldItemList.php, line 120
Class
- ModerationStateFieldItemList
- A computed field that provides a content entity's moderation state.
Namespace
Drupal\content_moderation\Plugin\FieldCode
public function onChange($delta) {
$this
->updateModeratedEntity($this->list[$delta]->value);
parent::onChange($delta);
}