function RulesConditionContainer::stateVariables

Overridden to exclude variable assertions of negated conditions.

Overrides RulesContainerPlugin::stateVariables

1 method overrides RulesConditionContainer::stateVariables()
RulesOr::stateVariables in includes/rules.plugins.inc
Overrides RulesContainerPlugin::stateVariables().

File

includes/rules.core.inc, line 2661

Class

RulesConditionContainer
Base class for all condition containers.

Code

protected function stateVariables($element = NULL) {
    $vars = $this->availableVariables();
    if (isset($element)) {
        // Add in variables provided by siblings executed before the element.
        foreach ($this->children as $child) {
            if ($child === $element) {
                break;
            }
            $vars += $child->providesVariables();
            // Take variable info assertions into account.
            if (!$this->negate && !$child->isNegated() && ($assertions = $child->variableInfoAssertions())) {
                $vars = RulesData::addMetadataAssertions($vars, $assertions);
            }
        }
    }
    return $vars;
}