You are here

public function EntityOperations::entityUpdate in Config Entity Revisions 8.2

Respond to an entity update.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity that was just saved.

See also

hook_entity_update()

File

src/EntityOperations.php, line 153

Class

EntityOperations
Defines a class for reacting to entity events.

Namespace

Drupal\config_entity_revisions

Code

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();
  }
}