abstract class ScannerPluginBase in Search and Replace Scanner 8
Plugin for ScannerPluginBase class.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\scanner\Plugin\ScannerPluginBase implements ScannerPluginInterface uses StringTranslationTrait
Expanded class hierarchy of ScannerPluginBase
1 file declares its use of ScannerPluginBase
- Entity.php in src/
Plugin/ Scanner/ Entity.php
File
- src/
Plugin/ ScannerPluginBase.php, line 13
Namespace
Drupal\scanner\PluginView source
abstract class ScannerPluginBase extends PluginBase implements ScannerPluginInterface {
use StringTranslationTrait;
/**
* The temp store we use to store form values.
*
* @var Drupal\Core\TempStore\PrivateTempStoreFactory
*/
protected $tempStore;
/**
* The scanner plugin manager.
*
* @var Drupal\scanner\Plugin\ScannerPluginManager
*/
protected $scannerManager;
/**
* Constructs a ScannerPluginBase object.
*
* @param array $configuration
* The configuration.
* @param string $plugin_id
* The plugin id.
* @param mixed $plugin_definition
* The plugin definition.
* @param \Drupal\Core\TempStore\PrivateTempStoreFactory $tempStore
* The temporary store.
* @param \Drupal\scanner\Plugin\ScannerPluginManager $scannerManager
* The scanner manager.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, PrivateTempStoreFactory $tempStore, ScannerPluginManager $scannerManager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->tempStore = $tempStore;
$this->scannerManager = $scannerManager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('tempstore.private'), $container
->get('plugin.manager.scanner'));
}
/**
* Performs the search operation and returns the results.
*
* @param string $field
* The fully qualified name of the field (entityType:bundle:fieldname).
* @param string $values
* The input values from the form ($form_state values).
*
* @return array
* An array containing the entity titles and an array of matches in the
* entity.
*/
public abstract function search($field, array $values);
/**
* Performs the replace operation and returns the results;.
*
* @param string $field
* The fully qualified name of the field (entityType:bundle:fieldname).
* @param string $values
* The input values from the form ($form_state values).
* @param array $undo_data
* The array for data values.
*
* @return array
* An array containing both the old and new revision IDs for each affected
* entity.
*/
public abstract function replace($field, array $values, array $undo_data);
/**
* Performs the undo operation.
*
* @param array $data
* An array containing the old and new revision id for the enttiy.
*/
public abstract function undo(array $data);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
ScannerPluginBase:: |
protected | property | The scanner plugin manager. | |
ScannerPluginBase:: |
protected | property | The temp store we use to store form values. | |
ScannerPluginBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
ScannerPluginBase:: |
abstract public | function |
Performs the replace operation and returns the results;. Overrides ScannerPluginInterface:: |
1 |
ScannerPluginBase:: |
abstract public | function |
Performs the search operation and returns the results. Overrides ScannerPluginInterface:: |
1 |
ScannerPluginBase:: |
abstract public | function |
Performs the undo operation. Overrides ScannerPluginInterface:: |
1 |
ScannerPluginBase:: |
public | function |
Constructs a ScannerPluginBase object. Overrides PluginBase:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |