You are here

public function SessionCondition::isMatched in Access Filter 8

Checks the current access is matched to the condition.

Parameters

\Symfony\Component\HttpFoundation\Request $request: A request instance.

Return value

bool Boolean TRUE if condition is matched or FALSE otherwise.

Overrides ConditionInterface::isMatched

File

src/Plugin/AccessFilter/Condition/SessionCondition.php, line 24

Class

SessionCondition
Filter condition using session value.

Namespace

Drupal\access_filter\Plugin\AccessFilter\Condition

Code

public function isMatched(Request $request) {
  $session = $request
    ->getSession();
  if ($session) {
    return $this
      ->isMatchedWithArray($session
      ->all());
  }
  return FALSE;
}