function WorkspaceAssociation::trackEntity

Updates or creates the association for a given entity and a workspace.

Parameters

\Drupal\Core\Entity\RevisionableInterface $entity: The entity to update or create from.

\Drupal\workspaces\WorkspaceInterface $workspace: The workspace in which the entity will be tracked.

Overrides WorkspaceAssociationInterface::trackEntity

File

core/modules/workspaces/src/WorkspaceAssociation.php, line 29

Class

WorkspaceAssociation
Provides a class for CRUD operations on workspace associations.

Namespace

Drupal\workspaces

Code

public function trackEntity(RevisionableInterface $entity, WorkspaceInterface $workspace) {
  $this->workspaceTracker
    ->trackEntity($workspace->id(), $workspace);
}

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