class QueryParameterWorkspaceNegotiator extends SessionWorkspaceNegotiator (View source)

Defines the query parameter workspace negotiator.

Properties

protected AccountInterface $currentUser

The current user.

from  SessionWorkspaceNegotiator
protected Session $session

The session.

from  SessionWorkspaceNegotiator
protected EntityStorageInterface $workspaceStorage

The workspace storage handler.

from  SessionWorkspaceNegotiator

Methods

__construct(AccountInterface $current_user, Session $session, EntityTypeManagerInterface $entity_type_manager)

Constructor.

bool
applies(Request $request)

Checks whether the negotiator applies to the current request or not.

getActiveWorkspace(Request $request)

Gets the negotiated workspace, if any.

setActiveWorkspace(WorkspaceInterface $workspace)

Sets the negotiated workspace.

unsetActiveWorkspace()

Unsets the negotiated workspace.

Details

__construct(AccountInterface $current_user, Session $session, EntityTypeManagerInterface $entity_type_manager)

Constructor.

Parameters

AccountInterface $current_user

The current user.

Session $session

The session.

EntityTypeManagerInterface $entity_type_manager

The entity type manager.

bool applies(Request $request)

Checks whether the negotiator applies to the current request or not.

Parameters

Request $request

The HTTP request.

Return Value

bool

TRUE if the negotiator applies for the current request, FALSE otherwise.

WorkspaceInterface|null getActiveWorkspace(Request $request)

Gets the negotiated workspace, if any.

Note that it is the responsibility of each implementation to check whether the negotiated workspace actually exists in the storage.

Parameters

Request $request

The HTTP request.

Return Value

WorkspaceInterface|null

The negotiated workspace or NULL if the negotiator could not determine a valid workspace.

setActiveWorkspace(WorkspaceInterface $workspace)

Sets the negotiated workspace.

Parameters

WorkspaceInterface $workspace

The workspace entity.

unsetActiveWorkspace()

Unsets the negotiated workspace.