function AggregatorTestCase::uniqueFeed

Checks whether the feed name and URL are 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.

3 calls to AggregatorTestCase::uniqueFeed()
AddFeedTestCase::testAddFeed in modules/aggregator/aggregator.test
Creates and ensures that a feed is unique, checks source, and deletes feed.
AddFeedTestCase::testAddLongFeed in modules/aggregator/aggregator.test
Tests feeds with very long URLs.
UpdateFeedTestCase::testUpdateFeed in modules/aggregator/aggregator.test
Creates a feed and attempts to update it.

File

modules/aggregator/aggregator.test, line 195

Class

AggregatorTestCase
Defines a base class for testing the 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;
}

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