You are here

public function EntityOperations::entityUpdate in Workbench Moderation 8

Same name and namespace in other branches
  1. 8.2 src/EntityOperations.php \Drupal\workbench_moderation\EntityOperations::entityUpdate()

Hook bridge.

Parameters

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

See also

hook_entity_update()

File

src/EntityOperations.php, line 215

Class

EntityOperations
Defines a class for reacting to entity events.

Namespace

Drupal\workbench_moderation

Code

public function entityUpdate(EntityInterface $entity) {
  if (!$this->moderationInfo
    ->isModeratableEntity($entity)) {
    return;
  }

  /* ContentEntityInterface $entity */

  // Update our own record keeping.
  $this->tracker
    ->setLatestRevision($entity
    ->getEntityTypeId(), $entity
    ->id(), $entity
    ->language()
    ->getId(), $entity
    ->getRevisionId());
}