interface WorkspaceNegotiatorInterface

Same name in other branches
  1. 9 core/modules/workspaces/src/Negotiator/WorkspaceNegotiatorInterface.php \Drupal\workspaces\Negotiator\WorkspaceNegotiatorInterface
  2. 8.9.x core/modules/workspaces/src/Negotiator/WorkspaceNegotiatorInterface.php \Drupal\workspaces\Negotiator\WorkspaceNegotiatorInterface
  3. 10 core/modules/workspaces/src/Negotiator/WorkspaceNegotiatorInterface.php \Drupal\workspaces\Negotiator\WorkspaceNegotiatorInterface

Workspace negotiators provide a way to get the active workspace.

\Drupal\workspaces\WorkspaceManager acts as the service collector for Workspace negotiators.

Hierarchy

Expanded class hierarchy of WorkspaceNegotiatorInterface

All classes that implement WorkspaceNegotiatorInterface

1 file declares its use of WorkspaceNegotiatorInterface
TestWorkspaceNegotiator.php in core/modules/workspaces/tests/modules/workspace_update_test/src/Negotiator/TestWorkspaceNegotiator.php

File

core/modules/workspaces/src/Negotiator/WorkspaceNegotiatorInterface.php, line 14

Namespace

Drupal\workspaces\Negotiator
View source
interface WorkspaceNegotiatorInterface {
    
    /**
     * Checks whether the negotiator applies to the current request or not.
     *
     * @param \Symfony\Component\HttpFoundation\Request $request
     *   The HTTP request.
     *
     * @return bool
     *   TRUE if the negotiator applies for the current request, FALSE otherwise.
     */
    public function applies(Request $request);
    
    /**
     * Notifies the negotiator that the workspace ID returned has been accepted.
     *
     * @param \Drupal\workspaces\WorkspaceInterface $workspace
     *   The negotiated workspace entity.
     */
    public function setActiveWorkspace(WorkspaceInterface $workspace);
    
    /**
     * Unsets the negotiated workspace.
     */
    public function unsetActiveWorkspace();

}

Members

Title Sort descending Modifiers Object type Summary Overrides
WorkspaceNegotiatorInterface::applies public function Checks whether the negotiator applies to the current request or not. 2
WorkspaceNegotiatorInterface::setActiveWorkspace public function Notifies the negotiator that the workspace ID returned has been accepted. 2
WorkspaceNegotiatorInterface::unsetActiveWorkspace public function Unsets the negotiated workspace. 2

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.