function RulesOr::evaluate

Overrides RulesPlugin::evaluate

File

includes/rules.plugins.inc, line 612

Class

RulesOr
A logical OR.

Code

public function evaluate(RulesState $state) {
    foreach ($this->children as $condition) {
        if ($condition->evaluate($state)) {
            rules_log('%condition evaluated to %bool.', array(
                '%condition' => $this->label(),
                '%bool' => 'TRUE',
            ));
            return !$this->negate;
        }
    }
    rules_log('%condition evaluated to %bool.', array(
        '%condition' => $this->label(),
        '%bool' => 'FALSE',
    ));
    return $this->negate;
}