You are here

public function RulesContainerPlugin::parameterInfo in Rules 7.2

Returns info about parameters needed for executing the configured plugin.

Parameters

bool $optional: Whether optional parameters should be included.

Overrides RulesPlugin::parameterInfo

See also

self::pluginParameterInfo()

1 call to RulesContainerPlugin::parameterInfo()
RulesContainerPlugin::setUpVariables in includes/rules.core.inc
Returns info about all variables that have to be setup in the state.

File

includes/rules.core.inc, line 2245
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 parameterInfo($optional = FALSE) {
  $params = parent::parameterInfo($optional);
  if (isset($this->info['variables'])) {
    foreach ($this->info['variables'] as $name => $var_info) {
      if (empty($var_info['handler']) && (!isset($var_info['parameter']) || $var_info['parameter'])) {
        $params[$name] = $var_info;

        // For lists allow empty variables by default.
        if (entity_property_list_extract_type($var_info['type'])) {
          $params[$name] += array(
            'allow null' => TRUE,
          );
        }
      }
    }
  }
  return $params;
}