Scalr\Stats\CostAnalytics\Prices::hasPriceForUrl PHP Method

hasPriceForUrl() public method

Checks whether there is some price for specified platform and url
public hasPriceForUrl ( string $platform, string $url, string $cloudLocation = null ) : boolean
$platform string Cloud platform
$url string The endpoint url
$cloudLocation string optional The cloud location
return boolean Returns TRUE if there is some price for specified platform and url or FALSE otherwise
    public function hasPriceForUrl($platform, $url, $cloudLocation = null)
    {
        $res = $this->cadb->getOne("\n            SELECT EXISTS(\n                SELECT 1 FROM `price_history`\n                WHERE `platform` = ? AND url = ?\n                " . (!empty($cloudLocation) ? "AND cloud_location = " . $this->cadb->qstr($cloudLocation) : "") . "\n            ) AS `val`\n        ", [$platform, empty($url) ? '' : $this->normalizeUrl($url)]);
        return !!$res;
    }