You are here

public function RulesContainerPlugin::availableVariables in Rules 7.2

Returns info about variables available to be used as arguments for this element.

As this is called very often, e.g. during integrity checks, we statically cache the results.

Overrides RulesPlugin::availableVariables

See also

RulesPlugin::resetInternalCache()

5 calls to RulesContainerPlugin::availableVariables()
Rule::stateVariables in includes/rules.plugins.inc
Returns available state variables for an element.
RulesConditionContainer::stateVariables in includes/rules.core.inc
Overridden to exclude variable assertions of negated conditions.
RulesContainerPlugin::stateVariables in includes/rules.core.inc
Returns available state variables for an element.
RulesEventSet::stateVariables in includes/rules.plugins.inc
Returns available state variables for an element.
RulesOr::stateVariables in includes/rules.plugins.inc
Overrides RulesContainerPlugin::stateVariables().

File

includes/rules.core.inc, line 2261
Rules base classes and interfaces needed for any rule evaluation.

Class

RulesContainerPlugin
Base class for ContainerPlugins like Rules, Logical Operations or Loops.

Code

public function availableVariables() {
  if (!isset($this->availableVariables)) {
    if ($this
      ->isRoot()) {
      $this->availableVariables = RulesState::defaultVariables();
      if (isset($this->info['variables'])) {
        $this->availableVariables += $this->info['variables'];
      }
    }
    else {
      $this->availableVariables = $this->parent
        ->stateVariables($this);
    }
  }
  return $this->availableVariables;
}