You are here

public function ConflictTracker::useWorkspace in Multiversion 8.2

Sets the workspace to be used in subsequent queries.

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

Parameters

\Drupal\workspaces\Entity\Workspace $workspace: The id of the workspace.

Return value

\Drupal\multiversion\Conflict\ConflictTrackerInterface

Overrides ConflictTrackerInterface::useWorkspace

See also

\Drupal\workspaces\WorkspaceManagerInterface::getActiveWorkspace().

File

src/Conflict/ConflictTracker.php, line 57

Class

ConflictTracker
The Conflict Tracker service.

Namespace

Drupal\multiversion\Conflict

Code

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