You are here

protected function RulesConditionalPredicateElement::stateVariables in Conditional Rules 8

Same name and namespace in other branches
  1. 7 includes/rules_conditional.core.inc \RulesConditionalPredicateElement::stateVariables()

Adds predicate assertions to state.

File

includes/rules_conditional.core.inc, line 464
Conditional Rules framework implementation.

Class

RulesConditionalPredicateElement
Base conditional element that uses a predicate.

Code

protected function stateVariables($element = NULL) {
  if (!isset($element) || $element === $this->predicate) {
    return parent::stateVariables();
  }
  else {

    // Add assertions from the predicate.
    $variables = parent::stateVariables($element);
    if (isset($this->predicate) && ($assertions = $this->predicate
      ->call('variableInfoAssertions'))) {
      $variables = RulesData::addMetadataAssertions($variables, $assertions);
    }
    return $variables;
  }
}