public function DefaultProcessor::remove

Implements \Drupal\aggregator\Plugin\ProcessorInterface::remove().

Overrides ProcessorInterface::remove

File

drupal/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php, line 152
Contains \Drupal\aggregator\Plugin\aggregator\processor\DefaultProcessor.

Class

DefaultProcessor
Defines a default processor implementation.

Namespace

Drupal\aggregator\Plugin\aggregator\processor

Code

public function remove(Feed $feed) {
  $iids = Database::getConnection()
    ->query('SELECT iid FROM {aggregator_item} WHERE fid = :fid', array(
    ':fid' => $feed
      ->id(),
  ))
    ->fetchCol();
  if ($iids) {
    entity_delete_multiple('aggregator_item', $iids);
  }

  // @todo This should be moved out to caller with a different message maybe.
  drupal_set_message(t('The news items from %site have been removed.', array(
    '%site' => $feed
      ->label(),
  )));
}