Test Setup Failed
Push — master ( f46e6c...b515a7 )
by Sam
05:53
created

PLMatch   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 43
rs 10
c 0
b 0
f 0
wmc 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A schedule() 0 2 1
A series() 0 2 1
A result() 0 2 1
A homeTeam() 0 2 1
A resultSubmissions() 0 2 1
A venue() 0 2 1
A association() 0 2 1
A awayTeam() 0 2 1
A round() 0 2 1
A division() 0 2 1
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class PLMatch extends Model
8
{
9
10
    protected $fillable = array('name', 'start_date', 'end_date', 'association_id',  'series_id', 'division_id', 'schedule_id', 'round_id', 'venue_id', 'home_team_id', 'away_team_id');
11
12
    public function association() {
13
        return $this->belongsTo('App\Association');
14
    }
15
16
    public function series() {
17
        return $this->belongsTo('App\Series');
18
    }
19
20
    public function division() {
21
        return $this->belongsTo('App\Division');
22
    }
23
24
    public function schedule() {
25
        return $this->belongsTo('App\Schedule');
26
    }
27
28
    public function round() {
29
        return $this->belongsTo('App\Round');
30
    }
31
32
    public function venue() {
33
        return $this->belongsTo('App\Venue');
34
    }
35
36
    public function homeTeam() {
37
        return $this->belongsTo('App\Team', 'home_team_id');
38
    }
39
40
    public function awayTeam() {
41
        return $this->belongsTo('App\Team', 'away_team_id');
42
    }
43
44
    public function result() {
45
        return $this->hasOne('App\Result', 'match_id');
46
    }
47
48
    public function resultSubmissions() {
49
        return $this->hasMany('App\ResultSubmission', 'match_id');
50
    }
51
}
52