Completed
Push — master ( 898da4...b65b7b )
by Vincenzo
03:00
created

Match::homeTeam()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace App\Lib\DsManager\Models\Orm;
4
5
/**
6
 * Class Match
7
 * @package App\Lib\DsManager\Models\Orm
8
 */
9
class Match extends DsManagerOrm
10
{
11
12
    /**
13
     * @var string
14
     */
15
    protected $table = 'matches';
16
17
    /**
18
     * @var array
19
     */
20
    protected $fillable = [
21
        'home_team_id',
22
        'away_team_id'
23
    ];
24
25
    /**
26
     * @var array
27
     */
28
    protected $hidden = [
29
        'home_team_id',
30
        'away_team_id',
31
        'created_at',
32
        'updated_at',
33
        'info'
34
    ];
35
36
    /**
37
     * @var array
38
     */
39
    protected $casts = [
40
        'simulated' => 'boolean'
41
    ];
42
43
    /**
44
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
45
     */
46
    public function homeTeam()
47
    {
48
        return $this->belongsTo(Team::class, 'home_team_id');
49
    }
50
51
    /**
52
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
53
     */
54
    public function awayTeam()
55
    {
56
        return $this->belongsTo(Team::class, 'away_team_id');
57
    }
58
59
}