createQuery()->orderBy('count_min ASC')->execute(); } public function getPriceAllForCount($value = 0) { foreach($this->getPrices() as $price) { if($price->getCountMin() >= $value) { return $price->getPriceOne() * $value; } } return 0; } public function getPriceOneForCount($value = 0) { foreach($this->getPrices() as $price) { if($price->getCountMin() >= $value) { return $price->getPriceOne(); } } return 0; } }