class FeedQueueWorker in Feeds 8.3
Provides separate queue works for feed types.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\feeds\Plugin\Derivative\FeedQueueWorker implements ContainerDeriverInterface
Expanded class hierarchy of FeedQueueWorker
See also
\Drupal\feeds\Plugin\QueueWorker\FeedRefresh
File
- src/
Plugin/ Derivative/ FeedQueueWorker.php, line 15
Namespace
Drupal\feeds\Plugin\DerivativeView source
class FeedQueueWorker extends DeriverBase implements ContainerDeriverInterface {
/**
* The entity storage.
*
* @var \Drupal\Core\Entity\EntityStorageInterface
*/
protected $storage;
/**
* Constructs an FeedQueueWorker object.
*
* @param \Drupal\Core\Entity\EntityStorageInterface $storage
* The entity manager.
*/
public function __construct(EntityStorageInterface $storage) {
$this->storage = $storage;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static($container
->get('entity_type.manager')
->getStorage('feeds_feed_type'));
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
$derivatives = [];
foreach ($this->storage
->loadMultiple() as $feed_type) {
$derivatives[$feed_type
->id()] = [
'title' => t('Feed refresh: @feed_type_label', [
'@feed_type_label' => $feed_type
->label(),
]),
] + $base_plugin_definition;
}
return $derivatives;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
FeedQueueWorker:: |
protected | property | The entity storage. | |
FeedQueueWorker:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
FeedQueueWorker:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
|
FeedQueueWorker:: |
public | function | Constructs an FeedQueueWorker object. |