Inheritance: extends Illuminate\Database\Eloquent\Model
コード例 #1
0
ファイル: Contest.php プロジェクト: ppy/osu-web
 public function votesForUser($user = null)
 {
     if ($user === null) {
         return [];
     }
     $votes = ContestVote::where('contest_id', $this->id)->where('user_id', $user->user_id)->get();
     return $votes->map(function ($v) {
         return $v->contest_entry_id;
     })->toArray();
 }