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

MatchResult   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 48
rs 10

2 Methods

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