function RulesDataProcessor::prepareSetting

Prepares the processor for parameters.

It turns the settings into a suitable processor object, which gets invoked on evaluation time.

Parameters

$setting: The processor settings which are to be prepared.

$param_info: The info about the parameter to prepare the processor for.

array $var_info: An array of info about the available variables.

1 call to RulesDataProcessor::prepareSetting()
RulesPlugin::processSettings in includes/rules.core.inc
Processes the settings e.g. to prepare input evaluators.
1 method overrides RulesDataProcessor::prepareSetting()
RulesDataInputEvaluator::prepareSetting in includes/rules.processor.inc
Overridden to prepare input evaluator processors.

File

includes/rules.processor.inc, line 67

Class

RulesDataProcessor
Common base class for Rules data processors.

Code

public static function prepareSetting(&$setting, $param_info, $var_info = array()) {
  $processor = NULL;
  foreach (self::processors($param_info, FALSE) as $name => $info) {
    if (!empty($setting[$name])) {
      $object = new $info['class']($setting[$name], $param_info, $var_info, $processor);
      $processor = $object->getPreparedValue();
    }
  }
  $setting = $processor;
}