function WorkspaceProviderBase::entityUpdate

Acts after an entity has been updated.

Parameters

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

Overrides WorkspaceProviderInterface::entityUpdate

File

core/modules/workspaces/src/Provider/WorkspaceProviderBase.php, line 203

Class

WorkspaceProviderBase
Defines the base class for workspace providers.

Namespace

Drupal\workspaces\Provider

Code

public function entityUpdate(EntityInterface $entity) : void {
  // Only track new revisions.
  /** @var \Drupal\Core\Entity\RevisionableInterface $entity */
  if ($entity->getLoadedRevisionId() != $entity->getRevisionId()) {
    $this->workspaceAssociation
      ->trackEntity($entity, $this->workspaceManager
      ->getActiveWorkspace());
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.