source/Application/Model/Article.php
protected function createFetchFirstInPriceCategorySql($categoryPriceId)
    {
        $database = $this->getDatabase();

        $quotedPrice = $database->quote($this->oxarticles__oxprice->value);
        $quotedCategoryId = $database->quote($categoryPriceId);

        $query = "select 1 from " . $this->_getObjectViewName('oxcategories') . " where oxid=$quotedCategoryId and"
                 . "(   (oxpricefrom != 0 and oxpriceto != 0 and oxpricefrom <= $quotedPrice and oxpriceto >= $quotedPrice)"
                 . " or (oxpricefrom != 0 and oxpriceto = 0 and oxpricefrom <= $quotedPrice)"
                 . " or (oxpricefrom = 0 and oxpriceto != 0 and oxpriceto >= $quotedPrice)"
                 . ")";

        return $query;
    }
protected function createFetchFirstInPriceCategorySql($categoryPriceId)
    {
        $database = $this->getDatabase();

        $quotedPrice = $database->quote($this->oxarticles__oxprice->value);
        $quotedCategoryId = $database->quote($categoryPriceId);

        $query = "select 1 from " . $this->_getObjectViewName('oxcategories') . " where oxid=$quotedCategoryId and"
                 . "(   (oxpricefrom != 0 and oxpriceto != 0 and oxpricefrom <= $quotedPrice and oxpriceto >= $quotedPrice)"
                 . " or (oxpricefrom != 0 and oxpriceto = 0 and oxpricefrom <= $quotedPrice)"
                 . " or (oxpricefrom = 0 and oxpriceto != 0 and oxpriceto >= $quotedPrice)"
                 . ")";

        return $query;
    }
protected function createFetchFirstInPriceCategorySql ( $ categoryPriceId ) { $ database = $ this -> getDatabase ( ) ; $ quotedPrice = $ database -> quote ( $ this -> oxarticles__oxprice -> value ) ; $ quotedCategoryId = $ database -> quote ( $ categoryPriceId ) ; $ query = "select 1 from " . $ this -> _getObjectViewName ( 'oxcategories' ) . " where oxid=$quotedCategoryId and" . "(   (oxpricefrom != 0 and oxpriceto != 0 and oxpricefrom <= $quotedPrice and oxpriceto >= $quotedPrice)" . " or (oxpricefrom != 0 and oxpriceto = 0 and oxpricefrom <= $quotedPrice)" . " or (oxpricefrom = 0 and oxpriceto != 0 and oxpriceto >= $quotedPrice)" . ")" ; return $ query ; }
Create the sql for the fetchFirstInPriceCategory method.

@param string $categoryPriceId The price category id.

@return string The wished sql.
Create the sql for the fetchFirstInPriceCategory method .