You are here

protected function ContextHandlerTrait::processValue in Rules 8.3

Processes a single value.

Parameters

mixed $value: The current value.

array $processors: An array mapping processor plugin IDs to their configuration.

\Drupal\rules\Context\ExecutionStateInterface $rules_state: The current Rules execution state with context variables.

Return value

mixed THe processed value.

1 call to ContextHandlerTrait::processValue()
ContextHandlerTrait::processData in src/Context/ContextHandlerTrait.php
Process data context on the plugin, usually before it gets executed.

File

src/Context/ContextHandlerTrait.php, line 317

Class

ContextHandlerTrait
Provides methods for handling context based on the plugin configuration.

Namespace

Drupal\rules\Context

Code

protected function processValue($value, array $processors, ExecutionStateInterface $rules_state) {
  foreach ($processors as $processor_plugin_id => $configuration) {
    $data_processor = $this->processorManager
      ->createInstance($processor_plugin_id, $configuration);
    $value = $data_processor
      ->process($value, $rules_state);
  }
  return $value;
}