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 Carbon\Carbon;
9
10/**
11 * @property int $playcount
12 * @property int $user_id
13 * @property string $year_month
14 */
15class UserMonthlyPlaycount extends Model
16{
17 protected $table = 'osu_user_month_playcount';
18 public $timestamps = false;
19
20 public function startDate()
21 {
22 $year = substr($this->year_month, 0, 2);
23 $month = substr($this->year_month, 2, 2);
24
25 return Carbon::parse("{$year}-{$month}-01");
26 }
27}