class BrightcovePlaylistQueueWorker in Brightcove Video Connect 8
Same name and namespace in other branches
- 8.2 src/Plugin/QueueWorker/BrightcovePlaylistQueueWorker.php \Drupal\brightcove\Plugin\QueueWorker\BrightcovePlaylistQueueWorker
- 3.x src/Plugin/QueueWorker/BrightcovePlaylistQueueWorker.php \Drupal\brightcove\Plugin\QueueWorker\BrightcovePlaylistQueueWorker
Processes Entity Update Tasks for Playlist.
Plugin annotation
@QueueWorker(
id = "brightcove_playlist_queue_worker",
title = @Translation("Brightcove playlist 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\BrightcovePlaylistQueueWorker implements ContainerFactoryPluginInterface
- class \Drupal\Core\Queue\QueueWorkerBase implements QueueWorkerInterface
Expanded class hierarchy of BrightcovePlaylistQueueWorker
File
- src/
Plugin/ QueueWorker/ BrightcovePlaylistQueueWorker.php, line 21
Namespace
Drupal\brightcove\Plugin\QueueWorkerView source
class BrightcovePlaylistQueueWorker extends QueueWorkerBase implements ContainerFactoryPluginInterface {
/**
* The brightcove_playlist storage.
*
* @var \Drupal\Core\Entity\EntityStorageInterface
*/
protected $playlistStorage;
/**
* The brightcove_video storage.
*
* @var \Drupal\Core\Entity\EntityStorageInterface
*/
protected $videoStorage;
/**
* Constructs a new BrightcovePlaylistQueueWorker 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 $playlist_storage
* The brightcove_playlist storage.
* @param \Drupal\Core\Entity\EntityStorageInterface $video_storage
* The brightcove_video storage.
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityStorageInterface $playlist_storage, EntityStorageInterface $video_storage) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->playlistStorage = $playlist_storage;
$this->videoStorage = $video_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_playlist'), $container
->get('entity_type.manager')
->getStorage('brightcove_video'));
}
/**
* {@inheritdoc}
*/
public function processItem($data) {
/** @var \Brightcove\Object\Playlist $playlist */
$playlist = $data['playlist'];
try {
BrightcovePlaylist::createOrUpdate($playlist, $this->playlistStorage, $this->videoStorage, $data['api_client_id']);
} catch (\Exception $e) {
throw new RequeueException($e
->getMessage(), $e
->getCode(), $e);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BrightcovePlaylistQueueWorker:: |
protected | property | The brightcove_playlist storage. | |
BrightcovePlaylistQueueWorker:: |
protected | property | The brightcove_video storage. | |
BrightcovePlaylistQueueWorker:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
BrightcovePlaylistQueueWorker:: |
public | function |
Works on a single queue item. Overrides QueueWorkerInterface:: |
|
BrightcovePlaylistQueueWorker:: |
public | function |
Constructs a new BrightcovePlaylistQueueWorker 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. |