function ModerationStateFieldItemList::setValue
Same name in other branches
- 8.9.x core/modules/content_moderation/src/Plugin/Field/ModerationStateFieldItemList.php \Drupal\content_moderation\Plugin\Field\ModerationStateFieldItemList::setValue()
- 10 core/modules/content_moderation/src/Plugin/Field/ModerationStateFieldItemList.php \Drupal\content_moderation\Plugin\Field\ModerationStateFieldItemList::setValue()
- 11.x core/modules/content_moderation/src/Plugin/Field/ModerationStateFieldItemList.php \Drupal\content_moderation\Plugin\Field\ModerationStateFieldItemList::setValue()
Overrides ComputedItemListTrait::setValue
File
-
core/
modules/ content_moderation/ src/ Plugin/ Field/ ModerationStateFieldItemList.php, line 129
Class
- ModerationStateFieldItemList
- A computed field that provides a content entity's moderation state.
Namespace
Drupal\content_moderation\Plugin\FieldCode
public function setValue($values, $notify = TRUE) {
parent::setValue($values, $notify);
$this->valueComputed = TRUE;
// If the parent created a field item and if the parent should be notified
// about the change (e.g. this is not initialized with the current value),
// update the moderated entity.
if (isset($this->list[0]) && $notify) {
$this->updateModeratedEntity($this->list[0]->value);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.