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
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
- class \Drupal\rules\Plugin\RulesDataProcessor\NumericOffset extends \Drupal\Core\Plugin\PluginBase implements \Drupal\rules\Context\DataProcessorInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
Expanded class hierarchy of NumericOffset
File
-
src/
Plugin/ RulesDataProcessor/ NumericOffset.php, line 20
Namespace
Drupal\rules\Plugin\RulesDataProcessorView 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 |