fillInPosition() public static method

$scores shall be pre-sorted by pp (or whatever default scoring order).
public static fillInPosition ( $scores )
Example #1
0
 public function includeAllScoresBest(User $user)
 {
     return $this->item($user, function ($user) {
         $all = [];
         foreach (array_keys(Beatmap::MODES) as $mode) {
             $scores = $user->scoresBest($mode, true)->default()->orderBy('pp', 'DESC')->with('beatmapset', 'beatmap')->limit(100)->get();
             ScoreBestModel::fillInPosition($scores);
             $all[$mode] = json_collection($scores, new ScoreTransformer(), 'beatmap,beatmapset,weight');
         }
         return $all;
     });
 }