class BrightcovePlaylistPageQueueWorker in Brightcove Video Connect 8
Same name and namespace in other branches
- 8.2 src/Plugin/QueueWorker/BrightcovePlaylistPageQueueWorker.php \Drupal\brightcove\Plugin\QueueWorker\BrightcovePlaylistPageQueueWorker
- 3.x src/Plugin/QueueWorker/BrightcovePlaylistPageQueueWorker.php \Drupal\brightcove\Plugin\QueueWorker\BrightcovePlaylistPageQueueWorker
Processes Entity Update Tasks for Playlist.
Plugin annotation
@QueueWorker(
id = "brightcove_playlist_page_queue_worker",
title = @Translation("Brightcove client 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\BrightcovePlaylistPageQueueWorker implements ContainerFactoryPluginInterface
- class \Drupal\Core\Queue\QueueWorkerBase implements QueueWorkerInterface
Expanded class hierarchy of BrightcovePlaylistPageQueueWorker
File
- src/
Plugin/ QueueWorker/ BrightcovePlaylistPageQueueWorker.php, line 20
Namespace
Drupal\brightcove\Plugin\QueueWorkerView source
class BrightcovePlaylistPageQueueWorker extends QueueWorkerBase implements ContainerFactoryPluginInterface {
/**
* The playlist queue object.
*
* @var \Drupal\Core\Queue\QueueInterface
*/
protected $playlistQueue;
/**
* Constructs a new BrightcovePlaylistPageQueueWorker 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\Queue\QueueInterface $playlist_queue
* The queue object.
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, QueueInterface $playlist_queue) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->playlistQueue = $playlist_queue;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('queue')
->get('brightcove_playlist_queue_worker'));
}
/**
* {@inheritdoc}
*/
public function processItem($data) {
$cms = BrightcoveUtil::getCmsApi($data['api_client_id']);
// Get playlists.
$playlists = $cms
->listPlaylists(NULL, $data['items_per_page'], $data['page'] * $data['items_per_page']);
foreach ($playlists as $playlist) {
$this->playlistQueue
->createItem([
'api_client_id' => $data['api_client_id'],
'playlist' => $playlist,
]);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BrightcovePlaylistPageQueueWorker:: |
protected | property | The playlist queue object. | |
BrightcovePlaylistPageQueueWorker:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
BrightcovePlaylistPageQueueWorker:: |
public | function |
Works on a single queue item. Overrides QueueWorkerInterface:: |
|
BrightcovePlaylistPageQueueWorker:: |
public | function |
Constructs a new BrightcovePlaylistPageQueueWorker 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. |