You are here

protected function SessionKeyExists::doEvaluate in Rules Session Variables 2.0.x

Same name and namespace in other branches
  1. 2.x src/Plugin/Condition/SessionKeyExists.php \Drupal\rules_session_vars\Plugin\Condition\SessionKeyExists::doEvaluate()

Evaluate session has key/value set.

Parameters

string $session_key: The session key.

Return value

bool TRUE if session key exists, FALSE otherwise.

File

src/Plugin/Condition/SessionKeyExists.php, line 72

Class

SessionKeyExists
Provides a 'Session key exists' condition.

Namespace

Drupal\rules_session_vars\Plugin\Condition

Code

protected function doEvaluate($session_key) {
  if ($this->session && $this->session
    ->get($session_key)) {
    return TRUE;
  }
  return FALSE;
}