class TestFetcher

Defines a test fetcher implementation.

Uses http_default_client class to download the feed.

Plugin annotation


@AggregatorFetcher(
  id = "aggregator_test_fetcher",
  title = @Translation("Test fetcher"),
  description = @Translation("Dummy fetcher for testing purposes.")
)

Hierarchy

Expanded class hierarchy of TestFetcher

File

drupal/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/fetcher/TestFetcher.php, line 28
Contains \Drupal\aggregator_test\Plugin\aggregator\fetcher\TestFetcher.

Namespace

Drupal\aggregator_test\Plugin\aggregator\fetcher
View source
class TestFetcher extends DefaultFetcher implements FetcherInterface {

  /**
   * Implements \Drupal\aggregator\Plugin\FetcherInterface::fetch().
   */
  public function fetch(Feed $feed) {
    if ($feed
      ->label() == 'Do not fetch') {
      return FALSE;
    }
    return parent::fetch($feed);
  }

}

Members