class BrightcovePlayerDeleteQueueWorker in Brightcove Video Connect 8
Same name and namespace in other branches
- 8.2 src/Plugin/QueueWorker/BrightcovePlayerDeleteQueueWorker.php \Drupal\brightcove\Plugin\QueueWorker\BrightcovePlayerDeleteQueueWorker
- 3.x src/Plugin/QueueWorker/BrightcovePlayerDeleteQueueWorker.php \Drupal\brightcove\Plugin\QueueWorker\BrightcovePlayerDeleteQueueWorker
Processes Entity Delete Tasks for Player.
Plugin annotation
@QueueWorker(
id = "brightcove_player_delete_queue_worker",
title = @Translation("Brightcove player 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\BrightcovePlayerDeleteQueueWorker implements ContainerFactoryPluginInterface
- class \Drupal\Core\Queue\QueueWorkerBase implements QueueWorkerInterface
Expanded class hierarchy of BrightcovePlayerDeleteQueueWorker
File
- src/
Plugin/ QueueWorker/ BrightcovePlayerDeleteQueueWorker.php, line 20
Namespace
Drupal\brightcove\Plugin\QueueWorkerView source
class BrightcovePlayerDeleteQueueWorker extends QueueWorkerBase implements ContainerFactoryPluginInterface {
/**
* The brightcove_player storage.
*
* @var \Drupal\Core\Entity\EntityStorageInterface
*/
protected $storage;
/**
* Constructs a new BrightcovePlayerDeleteQueueWorker object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin_id for the plugin instance.
* @param array $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Entity\EntityStorageInterface $storage
* The storage object.
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageInterface $storage) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->storage = $storage;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('entity_type.manager')
->getStorage('brightcove_player'));
}
/**
* {@inheritdoc}
*/
public function processItem($data) {
if (isset($data['player_id'])) {
/** @var \Drupal\brightcove\Entity\BrightcovePlayer $player */
$player = BrightcovePlayer::loadByPlayerId($data['player_id']);
if (!is_null($player)) {
$player
->delete();
}
}
elseif (isset($data['player_entity_id'])) {
/** @var \Drupal\brightcove\Entity\BrightcovePlayer $player */
$player = BrightcovePlayer::load($data['player_entity_id']);
if (!is_null($player)) {
$player
->delete();
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BrightcovePlayerDeleteQueueWorker:: |
protected | property | The brightcove_player storage. | |
BrightcovePlayerDeleteQueueWorker:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
BrightcovePlayerDeleteQueueWorker:: |
public | function |
Works on a single queue item. Overrides QueueWorkerInterface:: |
|
BrightcovePlayerDeleteQueueWorker:: |
public | function |
Constructs a new BrightcovePlayerDeleteQueueWorker 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. |