abstract class EncryptedFieldUpdateBase in Field Encryption 8.2
Provides base functionality for the EncryptedFieldUpdate Queue Workers.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Queue\QueueWorkerBase implements QueueWorkerInterface
- class \Drupal\field_encrypt\Plugin\QueueWorker\EncryptedFieldUpdateBase implements ContainerFactoryPluginInterface
- class \Drupal\Core\Queue\QueueWorkerBase implements QueueWorkerInterface
Expanded class hierarchy of EncryptedFieldUpdateBase
1 file declares its use of EncryptedFieldUpdateBase
- CronEncryptedFieldUpdate.php in src/
Plugin/ QueueWorker/ CronEncryptedFieldUpdate.php
File
- src/
Plugin/ QueueWorker/ EncryptedFieldUpdateBase.php, line 14
Namespace
Drupal\field_encrypt\Plugin\QueueWorkerView source
abstract class EncryptedFieldUpdateBase extends QueueWorkerBase implements ContainerFactoryPluginInterface {
/**
* The service the process entities.
*
* @var \Drupal\field_encrypt\FieldEncryptProcessEntitiesInterface.
*/
protected $processEntitiesService;
/**
* A configuration object.
*
* @var \Drupal\Core\Config\ImmutableConfig
*/
protected $config;
/**
* Creates a new EncryptedFieldUpdate object.
*
* @param \Drupal\field_encrypt\FieldEncryptProcessEntitiesInterface $process_entities_service
* The service the process entities.
* @param ConfigFactoryInterface $config_factory
* The configuration factory.
*/
public function __construct(FieldEncryptProcessEntitiesInterface $process_entities_service, ConfigFactoryInterface $config_factory) {
$this->processEntitiesService = $process_entities_service;
$this->config = $config_factory
->get('field_encrypt.settings');
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($container
->get('field_encrypt.process_entities'), $container
->get('config.factory'));
}
/**
* {@inheritdoc}
*/
public function processItem($data) {
// @TODO: remove config, if batch_size setting is irrelevant.
$this->processEntitiesService
->updateStoredField($data['field_name'], $data['entity_type'], $data['original_config'], $data['entity_id']);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EncryptedFieldUpdateBase:: |
protected | property | A configuration object. | |
EncryptedFieldUpdateBase:: |
protected | property | The service the process entities. | |
EncryptedFieldUpdateBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
EncryptedFieldUpdateBase:: |
public | function |
Works on a single queue item. Overrides QueueWorkerInterface:: |
|
EncryptedFieldUpdateBase:: |
public | function |
Creates a new EncryptedFieldUpdate object. Overrides PluginBase:: |
|
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. |