You are here

interface ProcessorInterface in Feeds 8.3

Interface for Feeds processor plugins.

Hierarchy

Expanded class hierarchy of ProcessorInterface

All classes that implement ProcessorInterface

21 files declare their use of ProcessorInterface
DefaultEntityProcessorForm.php in src/Feeds/Processor/Form/DefaultEntityProcessorForm.php
EntityIdTest.php in tests/src/Kernel/EntityIdTest.php
EntityReferenceTest.php in tests/src/Kernel/Feeds/Target/EntityReferenceTest.php
ExpireTest.php in tests/src/Functional/ExpireTest.php
FeedsItemTest.php in tests/src/Kernel/FeedsItemTest.php

... See full list

File

src/Plugin/Type/Processor/ProcessorInterface.php, line 13

Namespace

Drupal\feeds\Plugin\Type\Processor
View source
interface ProcessorInterface extends FeedsPluginInterface {

  /**
   * Skip new items from feed.
   *
   * @var int
   */
  const SKIP_NEW = 0;

  /**
   * Create new items from Feed.
   *
   * @var int
   */
  const INSERT_NEW = 1;

  /**
   * Skip items that exist already.
   *
   * @var int
   */
  const SKIP_EXISTING = 0;

  /**
   * Replace items that exist already.
   *
   * @var int
   */
  const REPLACE_EXISTING = 1;

  /**
   * Update items that exist already.
   *
   * @var int
   */
  const UPDATE_EXISTING = 2;

  /**
   * Feed items should never be expired.
   *
   * @var int
   */
  const EXPIRE_NEVER = -1;

  /**
   * Keep items that no longer exist in the feed.
   *
   * @var string
   */
  const KEEP_NON_EXISTENT = '_keep';

  /**
   * Delete items that no longer exist in the feed.
   *
   * @var string
   */
  const DELETE_NON_EXISTENT = '_delete';

  /**
   * Processes the results from a parser.
   *
   * @param \Drupal\feeds\FeedInterface $feed
   *   The feed being imported.
   * @param \Drupal\feeds\Feeds\Item\ItemInterface $item
   *   The item to process.
   * @param \Drupal\feeds\StateInterface $state
   *   The state object.
   */
  public function process(FeedInterface $feed, ItemInterface $item, StateInterface $state);

  /**
   * Called after an import is completed.
   *
   * @param \Drupal\feeds\FeedInterface $feed
   *   The feed.
   * @param \Drupal\feeds\StateInterface $state
   *   The state object.
   */
  public function postProcess(FeedInterface $feed, StateInterface $state);

  /**
   * Returns feed item ID's to expire.
   *
   * @param \Drupal\feeds\FeedInterface $feed
   *   The feed for which to get the expired item ID's.
   * @param int $time
   *   (optional) All items produced by this configuration that are older than
   *   REQUEST_TIME - $time that are expired. If null, the processor should use
   *   internal configuration. Defaults to null.
   *
   * @return array
   *   A list of item ID's.
   */
  public function getExpiredIds(FeedInterface $feed, $time = NULL);

  /**
   * Deletes feed items older than REQUEST_TIME - $time.
   *
   * Do not invoke expire on a processor directly. This is called automatically
   * after an import completes.
   *
   * @param \Drupal\feeds\FeedInterface $feed
   *   The feed to expire items for.
   * @param int $item_id
   *   The feed item id to expire.
   * @param \Drupal\feeds\StateInterface $state
   *   The state object.
   */
  public function expireItem(FeedInterface $feed, $item_id, StateInterface $state);

  /**
   * Counts the number of items imported by this processor.
   *
   * @param \Drupal\feeds\FeedInterface $feed
   *   The feed who's items we are counting.
   *
   * @return int
   *   The number of items imported by this feed.
   */
  public function getItemCount(FeedInterface $feed);

  /**
   * Returns a list of ID's of entities that were imported.
   *
   * @param \Drupal\feeds\FeedInterface $feed
   *   The feed to check fo imported entity ID's.
   *
   * @return array
   *   A list of entity ID's.
   */
  public function getImportedItemIds(FeedInterface $feed);

  /**
   * Returns the label for feed items created.
   *
   * @return string
   *   The item label.
   */
  public function getItemLabel();

  /**
   * Returns the plural label for feed items created.
   *
   * @return string
   *   The plural item label.
   */
  public function getItemLabelPlural();

  /**
   * Returns the age of items that should be removed.
   *
   * @return int
   *   The unix timestamp of the age of items to be removed.
   *
   * @todo Move this to a separate interface.
   */
  public function expiryTime();

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
FeedsPluginInterface::defaultFeedConfiguration public function Returns default feed configuration. 1
FeedsPluginInterface::pluginType public function Returns the type of plugin. 1
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
ProcessorInterface::DELETE_NON_EXISTENT constant Delete items that no longer exist in the feed.
ProcessorInterface::expireItem public function Deletes feed items older than REQUEST_TIME - $time. 1
ProcessorInterface::EXPIRE_NEVER constant Feed items should never be expired.
ProcessorInterface::expiryTime public function Returns the age of items that should be removed. 1
ProcessorInterface::getExpiredIds public function Returns feed item ID's to expire. 1
ProcessorInterface::getImportedItemIds public function Returns a list of ID's of entities that were imported. 1
ProcessorInterface::getItemCount public function Counts the number of items imported by this processor. 1
ProcessorInterface::getItemLabel public function Returns the label for feed items created. 1
ProcessorInterface::getItemLabelPlural public function Returns the plural label for feed items created. 1
ProcessorInterface::INSERT_NEW constant Create new items from Feed.
ProcessorInterface::KEEP_NON_EXISTENT constant Keep items that no longer exist in the feed.
ProcessorInterface::postProcess public function Called after an import is completed. 1
ProcessorInterface::process public function Processes the results from a parser. 1
ProcessorInterface::REPLACE_EXISTING constant Replace items that exist already.
ProcessorInterface::SKIP_EXISTING constant Skip items that exist already.
ProcessorInterface::SKIP_NEW constant Skip new items from feed.
ProcessorInterface::UPDATE_EXISTING constant Update items that exist already.