class BrightcoveCustomFieldDeleteQueueWorker in Brightcove Video Connect 8
Same name and namespace in other branches
- 8.2 src/Plugin/QueueWorker/BrightcoveCustomFieldDeleteQueueWorker.php \Drupal\brightcove\Plugin\QueueWorker\BrightcoveCustomFieldDeleteQueueWorker
- 3.x src/Plugin/QueueWorker/BrightcoveCustomFieldDeleteQueueWorker.php \Drupal\brightcove\Plugin\QueueWorker\BrightcoveCustomFieldDeleteQueueWorker
Processes Entity Delete Tasks for Custom Fields.
Plugin annotation
@QueueWorker(
id = "brightcove_custom_field_delete_queue_worker",
title = @Translation("Brightcove custom field delete queue worker."),
cron = { "time" = 30 }
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Queue\QueueWorkerBase implements QueueWorkerInterface
- class \Drupal\brightcove\Plugin\QueueWorker\BrightcoveCustomFieldDeleteQueueWorker implements ContainerFactoryPluginInterface
- class \Drupal\Core\Queue\QueueWorkerBase implements QueueWorkerInterface
Expanded class hierarchy of BrightcoveCustomFieldDeleteQueueWorker
File
- src/
Plugin/ QueueWorker/ BrightcoveCustomFieldDeleteQueueWorker.php, line 19
Namespace
Drupal\brightcove\Plugin\QueueWorkerView source
class BrightcoveCustomFieldDeleteQueueWorker extends QueueWorkerBase implements ContainerFactoryPluginInterface {
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition);
}
/**
* {@inheritdoc}
*/
public function processItem($data) {
// Delete custom field.
if ($data instanceof BrightcoveCustomField) {
$data
->delete();
}
else {
/** @var \Drupal\brightcove\Entity\BrightcoveCustomField $custom_field_entity */
$custom_field_entity = BrightcoveCustomField::load($data);
if (!is_null($custom_field_entity)) {
$custom_field_entity
->delete();
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BrightcoveCustomFieldDeleteQueueWorker:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
BrightcoveCustomFieldDeleteQueueWorker:: |
public | function |
Works on a single queue item. Overrides QueueWorkerInterface:: |
|
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. | |
PluginBase:: |
public | function | Constructs a \Drupal\Component\Plugin\PluginBase object. | 92 |