Round::series()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Round extends Model
8
{
9
10
    protected $fillable = array('name', 'start_date', 'end_date', 'association_id', 'series_id', 'division_id', 'schedule_id', 'scores_closed');
11
12
    /**
13
     * The attributes that should be mutated to dates.
14
     *
15
     * @var array
16
     */
17
    protected $dates = [
18
        'start_date',
19
        'end_date',
20
    ];
21
22
    // Round belongs to a series:
23
    public function series() {
24
        return $this->belongsTo('App\Series');
25
    }
26
27
    public function schedule()
28
    {
29
        return $this->belongsTo('App\Schedule');
30
    }
31
32
    public function matches() {
33
        return $this->hasMany('App\PLMatch')
34
            ->whereNotNull('home_team_id');
35
    }
36
37
}
38