You are here

protected function FeedsBatchExecutable::finish in Feeds 8.3

Finalizes the import.

Parameters

\Drupal\feeds\FeedInterface $feed: The feed which import batch is about to be finished.

\Drupal\feeds\Result\FetcherResultInterface $fetcher_result: The last fetcher result.

Return value

bool True if the last batch was done. False if the import is still ongoing.

Overrides FeedsExecutable::finish

File

src/FeedsBatchExecutable.php, line 22

Class

FeedsBatchExecutable
Import feeds using the batch API.

Namespace

Drupal\feeds

Code

protected function finish(FeedInterface $feed, FetcherResultInterface $fetcher_result) {
  $result = parent::finish($feed, $fetcher_result);
  if ($result) {

    // Start a batch for expiring items.
    $feed
      ->startBatchExpire();
  }
}