WorkspaceManagerInterface
interface WorkspaceManagerInterface (View source)
Provides an interface for managing Workspaces.
Methods
Returns whether an entity type can belong to a workspace or not.
Returns an array of entity types that can belong to workspaces.
Determines whether a workspace is active in the current request.
Gets the active workspace.
Sets the active workspace via the workspace negotiators.
Unsets the active workspace via the workspace negotiators.
Executes the given callback function in the context of a workspace.
Executes the given callback function without any workspace context.
Determines whether runtime entity operations should be altered.
Deletes the revisions associated with deleted workspaces.
Details
bool
isEntityTypeSupported(EntityTypeInterface $entity_type)
Returns whether an entity type can belong to a workspace or not.
EntityTypeInterface[]
getSupportedEntityTypes()
Returns an array of entity types that can belong to workspaces.
bool
hasActiveWorkspace()
Determines whether a workspace is active in the current request.
WorkspaceInterface
getActiveWorkspace()
Gets the active workspace.
$this
setActiveWorkspace(WorkspaceInterface $workspace)
Sets the active workspace via the workspace negotiators.
$this
switchToLive()
Unsets the active workspace via the workspace negotiators.
mixed
executeInWorkspace(string $workspace_id, callable $function)
Executes the given callback function in the context of a workspace.
mixed
executeOutsideWorkspace(callable $function)
Executes the given callback function without any workspace context.
bool
shouldAlterOperations(EntityTypeInterface $entity_type)
Determines whether runtime entity operations should be altered.
purgeDeletedWorkspacesBatch()
Deletes the revisions associated with deleted workspaces.