public function getRating() { $query = new RatingQuery(); $query->orderByThreshold("DESC"); $query->limit(1); $query->where("threshold <= " . $this->getScore()); return $query->findOne(); }