You are here

public function RulesConditionalCase::stateVariables in Conditional Rules 8

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

File

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

Class

RulesConditionalCase
Switch case.

Code

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

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