function AggregatorTestBase::uniqueFeed

Checks whether the feed name and URL are unique.

Parameters

string $feed_name: String containing the feed name to check.

string $feed_url: String containing the feed url to check.

Return value

bool TRUE if feed is unique.

File

core/modules/aggregator/src/Tests/AggregatorTestBase.php, line 254

Class

AggregatorTestBase
Defines a base class for testing the Aggregator module.

Namespace

Drupal\aggregator\Tests

Code

public function uniqueFeed($feed_name, $feed_url) {
  $result = \Drupal::entityQuery('aggregator_feed')->condition('title', $feed_name)
    ->condition('url', $feed_url)
    ->count()
    ->execute();
  return 1 == $result;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.