the browser-facing portion of osu!
at master 780 B view raw
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 8use App\Transformers\LanguageTransformer; 9 10/** 11 * @property int $display_order 12 * @property int $language_id 13 * @property string $name 14 */ 15class Language extends Model 16{ 17 protected $table = 'osu_languages'; 18 protected $primaryKey = 'language_id'; 19 public $timestamps = false; 20 21 const UNSPECIFIED = 1; 22 23 public function newQuery($excludeDeleted = true) 24 { 25 return parent::newQuery()->orderBy('display_order', 'asc'); 26 } 27 28 public static function listing() 29 { 30 return json_collection(static::all(), new LanguageTransformer()); 31 } 32}