You are here

public function RulesConditionalCase::pluginParameterInfo in Conditional Rules 7

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

Returns info about parameters needed by the plugin.

Note that not necessarily all parameters are needed when executing the plugin, as values for the parameter might have been already configured via the element settings.

Overrides RulesPlugin::pluginParameterInfo

See also

self::parameterInfo()

File

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

Class

RulesConditionalCase
Switch case.

Code

public function pluginParameterInfo() {
  $parameterInfo = array(
    'value' => array(
      'type' => '*',
      'label' => t('Data value'),
      'description' => t('The value to compare the data with.'),
      'allow null' => TRUE,
    ),
    'fall_through' => array(
      'type' => 'boolean',
      'label' => t('Fall through'),
      'description' => t('Fall through to next case when complete. If this option is checked, the next case is automatically executed (regardless of the case value) when this case is finished. If not, the switch will terminate when the case is finished.'),
      'optional' => TRUE,
      'default value' => FALSE,
      'restriction' => 'input',
    ),
  );

  // Derive parameter info from switch variable selector.
  $dataSelector = isset($this->parent->settings['data:select']) ? $this->parent->settings['data:select'] : NULL;
  if ($wrapper = $this
    ->applyDataSelector($dataSelector)) {
    $parameterInfo['value']['type'] = $wrapper
      ->type();
  }
  return $parameterInfo;
}