class FeedsQueueExecutable in Feeds 8.3
Import feeds using the queue API.
Hierarchy
- class \Drupal\feeds\FeedsExecutable implements ContainerInjectionInterface, FeedsExecutableInterface uses DependencySerializationTrait, StringTranslationTrait, EventDispatcherTrait
- class \Drupal\feeds\FeedsQueueExecutable
Expanded class hierarchy of FeedsQueueExecutable
2 files declare their use of FeedsQueueExecutable
- FeedRefresh.php in src/
Plugin/ QueueWorker/ FeedRefresh.php - FeedRefreshTest.php in tests/
src/ Unit/ Plugin/ QueueWorker/ FeedRefreshTest.php
File
- src/
FeedsQueueExecutable.php, line 16
Namespace
Drupal\feedsView source
class FeedsQueueExecutable extends FeedsExecutable {
/**
* The queue factory.
*
* @var \Drupal\Core\Queue\QueueFactory
*/
protected $queueFactory;
/**
* Constructs a new FeedsQueueExecutable object.
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
* The event dispatcher.
* @param \Drupal\Core\Session\AccountSwitcherInterface $account_switcher
* The account switcher.
* @param \Drupal\Core\Messenger\MessengerInterface $messenger
* The messenger service.
* @param \Drupal\Core\Queue\QueueFactory $queue_factory
* The queue factory.
*/
public function __construct(EntityTypeManagerInterface $entity_type_manager, EventDispatcherInterface $event_dispatcher, AccountSwitcherInterface $account_switcher, MessengerInterface $messenger, QueueFactory $queue_factory) {
parent::__construct($entity_type_manager, $event_dispatcher, $account_switcher, $messenger);
$this->queueFactory = $queue_factory;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('entity_type.manager'), $container
->get('event_dispatcher'), $container
->get('account_switcher'), $container
->get('messenger'), $container
->get('queue'));
}
/**
* {@inheritdoc}
*/
protected function createBatch(FeedInterface $feed, $stage) {
return new FeedsQueueBatch($this, $feed, $stage, $this->queueFactory);
}
/**
* {@inheritdoc}
*/
protected function handleException(FeedInterface $feed, $stage, array $params, Exception $exception) {
$feed
->finishImport();
if ($exception instanceof EmptyFeedException) {
return;
}
throw $exception;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
EventDispatcherTrait:: |
private | property | The event dispatcher service. | |
EventDispatcherTrait:: |
protected | function | Dispatches an event. | |
EventDispatcherTrait:: |
protected | function | Returns the event dispatcher service. | |
EventDispatcherTrait:: |
public | function | Sets the event dispatcher service to use. | |
FeedsExecutable:: |
protected | property | The account switcher. | |
FeedsExecutable:: |
protected | property | The entity type manager. | |
FeedsExecutable:: |
protected | property | The messenger service. | |
FeedsExecutable:: |
protected | function | Cleans an entity. | |
FeedsExecutable:: |
protected | function | Invokes the fetch stage. | |
FeedsExecutable:: |
protected | function | Parses. | |
FeedsExecutable:: |
protected | function | Processes an item. | |
FeedsExecutable:: |
protected | function | Finalizes the import. | 1 |
FeedsExecutable:: |
protected | function | Begin an import. | |
FeedsExecutable:: |
public | function |
Processes a stage of an import. Overrides FeedsExecutableInterface:: |
|
FeedsExecutable:: |
protected | function | Safely switches to another account. | |
FeedsExecutableInterface:: |
constant | Parameter passed when starting a new import. | ||
FeedsExecutableInterface:: |
constant | Parameter passed when cleaning. | ||
FeedsExecutableInterface:: |
constant | Parameter passed when fetching. | ||
FeedsExecutableInterface:: |
constant | Parameter passed when finishing. | ||
FeedsExecutableInterface:: |
constant | Parameter passed when parsing. | ||
FeedsExecutableInterface:: |
constant | Parameter passed when processing. | ||
FeedsQueueExecutable:: |
protected | property | The queue factory. | |
FeedsQueueExecutable:: |
public static | function |
Instantiates a new instance of this class. Overrides FeedsExecutable:: |
|
FeedsQueueExecutable:: |
protected | function |
Creates a new batch object. Overrides FeedsExecutable:: |
|
FeedsQueueExecutable:: |
protected | function |
Handles an exception during importing. Overrides FeedsExecutable:: |
|
FeedsQueueExecutable:: |
public | function |
Constructs a new FeedsQueueExecutable object. Overrides FeedsExecutable:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |