AggregatorTestCase::uniqueFeed

7 aggregator.test AggregatorTestCase::uniqueFeed($feed_name, $feed_url)
8 aggregator.test AggregatorTestCase::uniqueFeed($feed_name, $feed_url)

Check if the feed name and url is unique.

Parameters

$feed_name: String containing the feed name to check.

$feed_url: String containing the feed url to check.

Return value

TRUE if feed is unique.

File

modules/aggregator/aggregator.test, line 179
Tests for aggregator.module.

Code

function uniqueFeed($feed_name, $feed_url) {
  $result = db_query("SELECT COUNT(*) FROM {aggregator_feed} WHERE title = :title AND url = :url", array(':title' => $feed_name, ':url' => $feed_url))->fetchField();
  return (1 == $result);
}
Login or register to post comments