3 namespace Drupal\aggregator\Plugin;
5 use Drupal\aggregator\FeedInterface;
8 * Defines an interface for aggregator processor implementations.
10 * A processor acts on parsed feed data. Active processors are called at the
11 * third and last of the aggregation stages: first, data is downloaded by the
12 * active fetcher; second, it is converted to a common format by the active
13 * parser; and finally, it is passed to all active processors that manipulate or
16 * @see \Drupal\aggregator\Annotation\AggregatorProcessor
17 * @see \Drupal\aggregator\Plugin\AggregatorPluginSettingsBase
18 * @see \Drupal\aggregator\Plugin\AggregatorPluginManager
21 interface ProcessorInterface {
24 * Processes feed data.
26 * @param \Drupal\aggregator\FeedInterface $feed
27 * A feed object representing the resource to be processed.
28 * $feed->items contains an array of feed items downloaded and parsed at the
29 * parsing stage. See \Drupal\aggregator\Plugin\FetcherInterface::parse()
30 * for the basic format of a single item in the $feed->items array.
31 * For the exact format refer to the particular parser in use.
33 public function process(FeedInterface $feed);
36 * Refreshes feed information.
38 * Called after the processing of the feed is completed by all selected
41 * @param \Drupal\aggregator\FeedInterface $feed
42 * Object describing feed.
44 * @see aggregator_refresh()
46 public function postProcess(FeedInterface $feed);
49 * Deletes stored feed data.
51 * Called by aggregator if either a feed is deleted or a user clicks on
54 * @param \Drupal\aggregator\FeedInterface $feed
55 * The $feed object whose items are being deleted.
57 public function delete(FeedInterface $feed);