class NumericOffset

A data processor for applying numerical offsets.

The plugin configuration must contain the following entry:

  • offset: the value that should be added.

Plugin annotation


@RulesDataProcessor(
  id = "rules_numeric_offset",
  label = @Translation("Apply numeric offset")
)

Hierarchy

Expanded class hierarchy of NumericOffset

File

src/Plugin/RulesDataProcessor/NumericOffset.php, line 20

Namespace

Drupal\rules\Plugin\RulesDataProcessor
View source
class NumericOffset extends PluginBase implements DataProcessorInterface {
    
    /**
     * {@inheritdoc}
     */
    public function process($value, ExecutionStateInterface $rules_state) {
        return $value + $this->configuration['offset'];
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
NumericOffset::process public function Process the given value. Overrides DataProcessorInterface::process