You are here

public function Rule::evaluate in Rules 7.2

Evaluate, whereas by default new vars are visible in the parent's scope.

Overrides RulesActionContainer::evaluate

File

includes/rules.plugins.inc, line 241
Contains plugin info and implementations not needed for rule evaluation.

Class

Rule
An actual rule.

Code

public function evaluate(RulesState $state) {
  rules_log('Evaluating conditions of rule %label.', array(
    '%label' => $this->label,
  ), RulesLog::INFO, $this);
  if ($this->conditions
    ->evaluate($state)) {
    rules_log('Rule %label fires.', array(
      '%label' => $this->label,
    ), RulesLog::INFO, $this, TRUE);
    parent::evaluate($state);
    rules_log('Rule %label has fired.', array(
      '%label' => $this->label,
    ), RulesLog::INFO, $this, FALSE);
  }
}