function TestFetcher::fetch

Same name in other branches
  1. 8.9.x core/modules/aggregator/tests/modules/aggregator_test/src/Plugin/aggregator/fetcher/TestFetcher.php \Drupal\aggregator_test\Plugin\aggregator\fetcher\TestFetcher::fetch()

Overrides DefaultFetcher::fetch

File

core/modules/aggregator/tests/modules/aggregator_test/src/Plugin/aggregator/fetcher/TestFetcher.php, line 25

Class

TestFetcher
Defines a test fetcher implementation.

Namespace

Drupal\aggregator_test\Plugin\aggregator\fetcher

Code

public function fetch(FeedInterface $feed) {
    if ($feed->label() == 'Do not fetch') {
        return FALSE;
    }
    return parent::fetch($feed);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.