createQuery()->orderBy('days_min ASC')->execute(); } public function getPriceOneForDays($value) { foreach($this->getPrices() as $price) { if($price->getDaysMin() >= $value) { return $price->getPriceDay(); } } return 0; } public function getPriceAllForDays($value) { foreach($this->getPrices() as $price) { if($price->getDaysMin() >= $value) { return $price->getPriceDay() * $value; } } return 0; } }