1<?php
2
3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
4// See the LICENCE file in the repository root for full licence text.
5
6namespace App\Models;
7
8/**
9 * @property int $attrib_id
10 * @property int $beatmap_id
11 * @property int $mode
12 * @property int $mods
13 * @property float|null $value
14 */
15class BeatmapDifficultyAttrib extends Model
16{
17 const NO_MODS = 0;
18 const MAX_COMBO = 9;
19
20 public $incrementing = false;
21 public $timestamps = false;
22
23 protected $primaryKey = ':composite';
24 protected $primaryKeys = ['beatmap_id', 'mode', 'mods', 'attrib_id'];
25 protected $table = 'osu_beatmap_difficulty_attribs';
26
27 public function scopeMode($query, $mode)
28 {
29 return $query->where('mode', $mode);
30 }
31
32 public function scopeMaxCombo($query)
33 {
34 return $query->where('attrib_id', static::MAX_COMBO);
35 }
36
37 public function scopeNoMods($query)
38 {
39 return $query->where('mods', static::NO_MODS);
40 }
41}