You are here

public function ConflictTracker::useWorkspace in Multiversion 8

Sets the workspace to be used in subsequent queries.

If no workspace is set the default workspace will be used.

Parameters

\Drupal\multiversion\Entity\WorkspaceInterface $workspace: The id of the workspace.

Return value

\Drupal\multiversion\Workspace\ConflictTrackerInterface

Overrides ConflictTrackerInterface::useWorkspace

See also

\Drupal\multiversion\Workspace\WorkspaceManagerInterface::getActiveWorkspace().

File

src/Workspace/ConflictTracker.php, line 56

Class

ConflictTracker
The Conflict Tracker service.

Namespace

Drupal\multiversion\Workspace

Code

public function useWorkspace(WorkspaceInterface $workspace = null) {
  $this->workspaceId = 0;
  if ($workspace) {
    $this->workspaceId = $workspace
      ->id();
  }
  return $this;
}