You are here

protected function FeedsExecutable::import in Feeds 8.3

Begin an import.

Parameters

\Drupal\feeds\FeedInterface $feed: The feed to perform an import on.

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

File

src/FeedsExecutable.php, line 200

Class

FeedsExecutable
Defines a feeds executable class.

Namespace

Drupal\feeds

Code

protected function import(FeedInterface $feed) {
  try {
    $feed
      ->lock();
  } catch (LockException $e) {
    $this->messenger
      ->addWarning($this
      ->t('The feed became locked before the import could begin.'));
    return;
  }
  $feed
    ->clearStates();
  $this
    ->createBatch($feed, static::FETCH)
    ->addOperation(static::FETCH)
    ->run();
}