interface ProcessorInterface

Defines an interface for aggregator processor implementations.

A processor acts on parsed feed data. Active processors are called at the third and last of the aggregation stages: first, data is downloaded by the active fetcher; second, it is converted to a common format by the active parser; and finally, it is passed to all active processors that manipulate or store the data.

Hierarchy

Expanded class hierarchy of ProcessorInterface

All classes that implement ProcessorInterface

2 files declare their use of ProcessorInterface
DefaultProcessor.php in drupal/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php
Contains \Drupal\aggregator\Plugin\aggregator\processor\DefaultProcessor.
TestProcessor.php in drupal/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php
Contains \Drupal\aggregator_test\Plugin\aggregator\processor\TestProcessor.

File

drupal/core/modules/aggregator/lib/Drupal/aggregator/Plugin/ProcessorInterface.php, line 21
Contains \Drupal\aggregator\Plugin\ProcessorInterface.

Namespace

Drupal\aggregator\Plugin
View source
interface ProcessorInterface {

  /**
   * Returns a form to configure settings for the processor.
   *
   * @param array $form
   *   The form definition array where the settings form is being included in.
   * @param array $form_state
   *   An associative array containing the current state of the form.
   *
   * @return array
   *   The form elements for the processor settings.
   */
  public function settingsForm(array $form, array &$form_state);

  /**
   * Adds processor specific submission handling for the configuration form.
   *
   * @param array $form
   *   The form definition array where the settings form is being included in.
   * @param array $form_state
   *   An associative array containing the current state of the form.
   *
   * @see \Drupal\aggregator\Plugin\ProcessorInterface::settingsForm()
   */
  public function settingsSubmit(array $form, array &$form_state);

  /**
   * Processes feed data.
   *
   * @param \Drupal\aggregator\Plugin\Core\Entity\Feed $feed
   *   A feed object representing the resource to be processed.
   *   $feed->items contains an array of feed items downloaded and parsed at the
   *   parsing stage. See \Drupal\aggregator\Plugin\FetcherInterface::parse()
   *   for the basic format of a single item in the $feed->items array.
   *   For the exact format refer to the particular parser in use.
   *
   */
  public function process(Feed $feed);

  /**
   * Refreshes feed information.
   *
   * Called after the processing of the feed is completed by all selected
   * processors.
   *
   * @param \Drupal\aggregator\Plugin\Core\Entity\Feed $feed
   *   Object describing feed.
   *
   * @see aggregator_refresh()
   */
  public function postProcess(Feed $feed);

  /**
   * Removes stored feed data.
   *
   * Called by aggregator if either a feed is deleted or a user clicks on
   * "remove items".
   *
   * @param \Drupal\aggregator\Plugin\Core\Entity\Feed $feed
   *   The $feed object whose items are being removed.
   *
   */
  public function remove(Feed $feed);

}

Members

Namesort descending Modifiers Type Description Overrides
ProcessorInterface::postProcess public function Refreshes feed information. 2
ProcessorInterface::process public function Processes feed data. 2
ProcessorInterface::remove public function Removes stored feed data. 2
ProcessorInterface::settingsForm public function Returns a form to configure settings for the processor. 2
ProcessorInterface::settingsSubmit public function Adds processor specific submission handling for the configuration form. 2