You are here

interface TamperInterface in Tamper 8

Interface definition for tamper plugins.

Hierarchy

Expanded class hierarchy of TamperInterface

All classes that implement TamperInterface

1 file declares its use of TamperInterface
TamperConfigSchemaTest.php in tests/src/Kernel/TamperConfigSchemaTest.php

File

src/TamperInterface.php, line 12

Namespace

Drupal\tamper
View source
interface TamperInterface extends PluginInspectionInterface, PluginFormInterface, ConfigurableInterface {

  /**
   * Tamper data.
   *
   * Performs the operations on the data to transform it.
   *
   * @param mixed $data
   *   The data to tamper.
   * @param \Drupal\tamper\TamperableItemInterface $item
   *   Item that can be tampered as part of a plugin's execution.
   *
   * @return mixed
   *   The tampered data.
   *
   * @throws \Drupal\tamper\Exception\TamperException
   *   When the plugin can not tamper the given data.
   * @throws \Drupal\tamper\Exception\SkipTamperDataException
   *   When the calling tamper process should be skipped for the given data.
   * @throws \Drupal\tamper\Exception\SkipTamperItemException
   *   When the calling tamper process should be skipped for the given item.
   */
  public function tamper($data, TamperableItemInterface $item = NULL);

  /**
   * Indicates whether the returned value requires multiple handling.
   *
   * @return bool
   *   TRUE when the returned value contains a list of values to be processed.
   *   For example, when the 'data' variable is a string and the tampered value
   *   is an array.
   */
  public function multiple();

  /**
   * Get a particular configuration value.
   *
   * @param string $key
   *   Key of the configuration.
   *
   * @return mixed|null
   *   Setting value if found.
   */
  public function getSetting($key);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
TamperInterface::getSetting public function Get a particular configuration value. 1
TamperInterface::multiple public function Indicates whether the returned value requires multiple handling. 1
TamperInterface::tamper public function Tamper data. 32