function EntityOperations::entityUpdate
Same name in this branch
- 9 core/modules/workspaces/src/EntityOperations.php \Drupal\workspaces\EntityOperations::entityUpdate()
Same name in other branches
- 8.9.x core/modules/content_moderation/src/EntityOperations.php \Drupal\content_moderation\EntityOperations::entityUpdate()
- 8.9.x core/modules/workspaces/src/EntityOperations.php \Drupal\workspaces\EntityOperations::entityUpdate()
- 10 core/modules/content_moderation/src/EntityOperations.php \Drupal\content_moderation\EntityOperations::entityUpdate()
- 10 core/modules/workspaces/src/EntityOperations.php \Drupal\workspaces\EntityOperations::entityUpdate()
- 11.x core/modules/content_moderation/src/EntityOperations.php \Drupal\content_moderation\EntityOperations::entityUpdate()
- 11.x core/modules/workspaces/src/EntityOperations.php \Drupal\workspaces\EntityOperations::entityUpdate()
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity that was just saved.
See also
File
-
core/
modules/ content_moderation/ src/ EntityOperations.php, line 147
Class
- EntityOperations
- Defines a class for reacting to entity events.
Namespace
Drupal\content_moderationCode
public function entityUpdate(EntityInterface $entity) {
if ($this->moderationInfo
->isModeratedEntity($entity)) {
$this->updateOrCreateFromEntity($entity);
}
elseif ($entity instanceof Workflow && $entity->getTypePlugin()
->getPluginId() == 'content_moderation') {
$this->routerBuilder
->setRebuildNeeded();
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.