public function getRating() { $query = new RatingsQuery(); $query->orderByThreshold("DESC"); $query->limit(1); $query->where("threshold <= " . $this->getScore()); return $query->findOne(); }
public static function getRatingForScore($score) { return RatingsQuery::create()->where('Ratings.Threshold <= ?', $score)->orderByThreshold("DESC")->findOne(); }