You are here

public function FeedStorage::getFeedDuplicates in MongoDB 8

@todo remove once https://drupal.org/node/2228733 is in.

File

mongodb_aggregator/src/Entity/FeedStorage.php, line 47
Contains Drupal\mongodb\Entity\FeedStorageController.

Class

FeedStorage

Namespace

Drupal\mongodb_aggregator\Entity

Code

public function getFeedDuplicates(FeedInterface $feed) {
  $query = \Drupal::entityQuery('aggregator_feed');
  $or_condition = $query
    ->orConditionGroup()
    ->condition('title', $feed
    ->label())
    ->condition('url', $feed
    ->getUrl());
  $query
    ->condition($or_condition);
  if ($feed
    ->id()) {
    $query
      ->condition('fid', $feed
      ->id(), '<>');
  }
  return $this
    ->loadMultiple($query
    ->execute());
}