function WorkspaceAssociation::trackEntity

Same name and namespace in other branches
  1. 10 core/modules/workspaces/src/WorkspaceAssociation.php \Drupal\workspaces\WorkspaceAssociation::trackEntity()
  2. 9 core/modules/workspaces/src/WorkspaceAssociation.php \Drupal\workspaces\WorkspaceAssociation::trackEntity()
  3. 8.9.x core/modules/workspaces/src/WorkspaceAssociation.php \Drupal\workspaces\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.