You are here

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

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

File

src/Plugin/Condition/SessionDataComparison.php, line 77

Class

SessionDataComparison
Provides a 'Session Data Comparison' condition.

Namespace

Drupal\rules_session_vars\Plugin\Condition

Code

protected function doEvaluate($sessionKey, $operation, $value) {
  if ($this->session && ($data = $this->session
    ->get($sessionKey))) {
    return parent::doEvaluate($data, $operation, $value);
  }

  // No SESSION data, so fail evaluation.
  return FALSE;
}