You are here

protected function RuleConditionSet::stateVariables in Conditional Rules 7

Same name and namespace in other branches
  1. 8 includes/rules_conditional.plugin.inc \RuleConditionSet::stateVariables()

Overridden to exclude variable assertions of negated conditions.

Overrides RulesConditionContainer::stateVariables

File

includes/rules_conditional.plugin.inc, line 553
Rules plugin implementation.

Class

RuleConditionSet
Rule as condition set.

Code

protected function stateVariables($element = NULL) {
  $vars = $this
    ->availableVariables();
  if (isset($element) && $element !== $this->actions) {

    // Provide action variables for conditions.
    foreach ($this->actions->children as $child) {
      $vars += $child
        ->providesVariables();
    }

    // Provide condition state variables.
    foreach ($this->children as $child) {
      if ($child === $element) {
        break;
      }
      $vars += $child
        ->providesVariables();

      // Assert variable info from child conditions.
      if (!$child
        ->isNegated() && ($assertions = $child
        ->variableInfoAssertions())) {
        $vars = RulesData::addMetadataAssertions($vars, $assertions);
      }
    }
  }
  return $vars;
}