You are here

protected function FeedsExecutable::doFetch in Feeds 8.3

Invokes the fetch stage.

Parameters

\Drupal\feeds\FeedInterface $feed: The feed to fetch.

1 call to FeedsExecutable::doFetch()
FeedsExecutable::processItem in src/FeedsExecutable.php
Processes a stage of an import.

File

src/FeedsExecutable.php, line 221

Class

FeedsExecutable
Defines a feeds executable class.

Namespace

Drupal\feeds

Code

protected function doFetch(FeedInterface $feed) {
  $this
    ->dispatchEvent(FeedsEvents::INIT_IMPORT, new InitEvent($feed, 'fetch'));
  $fetch_event = $this
    ->dispatchEvent(FeedsEvents::FETCH, new FetchEvent($feed));
  $feed
    ->setState(StateInterface::PARSE, NULL);
  $feed
    ->saveStates();
  $this
    ->createBatch($feed, static::PARSE)
    ->addOperation(static::PARSE, [
    'fetcher_result' => $fetch_event
      ->getFetcherResult(),
  ])
    ->run();
}