function SessionWorkspaceNegotiator::applies

Same name and namespace in other branches
  1. 9 core/modules/workspaces/src/Negotiator/SessionWorkspaceNegotiator.php \Drupal\workspaces\Negotiator\SessionWorkspaceNegotiator::applies()
  2. 8.9.x core/modules/workspaces/src/Negotiator/SessionWorkspaceNegotiator.php \Drupal\workspaces\Negotiator\SessionWorkspaceNegotiator::applies()
  3. 10 core/modules/workspaces/src/Negotiator/SessionWorkspaceNegotiator.php \Drupal\workspaces\Negotiator\SessionWorkspaceNegotiator::applies()

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

Parameters

\Symfony\Component\HttpFoundation\Request $request: The HTTP request.

Return value

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

Overrides WorkspaceNegotiatorInterface::applies

1 call to SessionWorkspaceNegotiator::applies()
QueryParameterWorkspaceNegotiator::applies in core/modules/workspaces/src/Negotiator/QueryParameterWorkspaceNegotiator.php
Checks whether the negotiator applies to the current request or not.
1 method overrides SessionWorkspaceNegotiator::applies()
QueryParameterWorkspaceNegotiator::applies in core/modules/workspaces/src/Negotiator/QueryParameterWorkspaceNegotiator.php
Checks whether the negotiator applies to the current request or not.

File

core/modules/workspaces/src/Negotiator/SessionWorkspaceNegotiator.php, line 25

Class

SessionWorkspaceNegotiator
Defines the session workspace negotiator.

Namespace

Drupal\workspaces\Negotiator

Code

public function applies(Request $request) {
  // This negotiator only applies if the current user is authenticated.
  return $this->currentUser
    ->isAuthenticated();
}

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