FeedsQueueExecutable.php in Feeds 8.3
File
src/FeedsQueueExecutable.php
View source
<?php
namespace Drupal\feeds;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Messenger\MessengerInterface;
use Drupal\Core\Queue\QueueFactory;
use Drupal\Core\Session\AccountSwitcherInterface;
use Exception;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class FeedsQueueExecutable extends FeedsExecutable {
protected $queueFactory;
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;
}
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'));
}
protected function createBatch(FeedInterface $feed, $stage) {
return new FeedsQueueBatch($this, $feed, $stage, $this->queueFactory);
}
protected function handleException(FeedInterface $feed, $stage, array $params, Exception $exception) {
$feed
->finishImport();
if ($exception instanceof EmptyFeedException) {
return;
}
throw $exception;
}
}