You are here

public function FeedsYouTubeFetcher::fetch in Feeds: YouTube Parser 8

Fetch content from a feed and return it.

Parameters

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

\Drupal\feeds\StateInterface $state: The state object.

Return value

\Drupal\feeds\Result\FetcherResultInterface A fetcher result object.

Overrides FetcherInterface::fetch

File

src/Feeds/Fetcher/FeedsYouTubeFetcher.php, line 33

Class

FeedsYouTubeFetcher
Constructs FeedsYouTubeFetcher object.

Namespace

Drupal\feeds_youtube\Feeds\Fetcher

Code

public function fetch(FeedInterface $feed, StateInterface $state) {
  $result = $this
    ->get($feed
    ->getSource(), $feed
    ->id());
  if ($result !== FALSE) {
    return new RawFetcherResult($result);
  }
  else {
    return new RawFetcherResult('');
  }
}