class TestFetcher
Same name in other branches
- 8.9.x core/modules/aggregator/tests/modules/aggregator_test/src/Plugin/aggregator/fetcher/TestFetcher.php \Drupal\aggregator_test\Plugin\aggregator\fetcher\TestFetcher
Defines a test fetcher implementation.
Uses http_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
- class \Drupal\aggregator\Plugin\aggregator\fetcher\DefaultFetcher implements \Drupal\aggregator\Plugin\FetcherInterface, \Drupal\Core\Plugin\ContainerFactoryPluginInterface uses \Drupal\Core\StringTranslation\StringTranslationTrait
- class \Drupal\aggregator_test\Plugin\aggregator\fetcher\TestFetcher extends \Drupal\aggregator\Plugin\aggregator\fetcher\DefaultFetcher implements \Drupal\aggregator\Plugin\FetcherInterface
Expanded class hierarchy of TestFetcher
File
-
core/
modules/ aggregator/ tests/ modules/ aggregator_test/ src/ Plugin/ aggregator/ fetcher/ TestFetcher.php, line 20
Namespace
Drupal\aggregator_test\Plugin\aggregator\fetcherView source
class TestFetcher extends DefaultFetcher implements FetcherInterface {
/**
* {@inheritdoc}
*/
public function fetch(FeedInterface $feed) {
if ($feed->label() == 'Do not fetch') {
return FALSE;
}
return parent::fetch($feed);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
DefaultFetcher::$httpClientFactory | protected | property | The HTTP client to fetch the feed data with. | ||
DefaultFetcher::$logger | protected | property | A logger instance. | ||
DefaultFetcher::$messenger | protected | property | The messenger. | ||
DefaultFetcher::create | public static | function | Creates an instance of the plugin. | Overrides ContainerFactoryPluginInterface::create | |
DefaultFetcher::__construct | public | function | Constructs a DefaultFetcher object. | ||
StringTranslationTrait::$stringTranslation | protected | property | The string translation service. | 3 | |
StringTranslationTrait::formatPlural | protected | function | Formats a string containing a count of items. | ||
StringTranslationTrait::getNumberOfPlurals | protected | function | Returns the number of plurals supported by a given language. | ||
StringTranslationTrait::getStringTranslation | protected | function | Gets the string translation service. | ||
StringTranslationTrait::setStringTranslation | public | function | Sets the string translation service to use. | 2 | |
StringTranslationTrait::t | protected | function | Translates a string to the current language or to a given language. | ||
TestFetcher::fetch | public | function | Downloads feed data. | Overrides DefaultFetcher::fetch |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.