TeamMember::tournamentTeam()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 4
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent;
7
8
/**
9
 * Class TeamMember
10
 * @package App
11
 */
12 View Code Duplication
class TeamMember extends Model
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
15
    /**
16
     * @var string
17
     */
18
    protected $table = 'team_members';
19
20
    /**
21
     * @var array
22
     */
23
    protected $fillable = ['memberId', 'tournamentTeamId'];
24
25
    /**
26
     * !!! Looks like an ugly workaround !!!
27
     *
28
     * @return string
29
     */
30
    public function getKeyName()
31
    {
32
        return 'tournamentTeamId';
33
    }
34
35
    /**
36
     * @var bool
37
     */
38
    public $timestamps = false;
39
40
    /**
41
     * @return Eloquent\Relations\BelongsTo
42
     */
43
    public function member()
44
    {
45
        return $this->belongsTo(Member::class, 'memberId');
46
    }
47
48
    /**
49
     * @return Eloquent\Relations\BelongsTo
50
     */
51
    public function tournamentTeam()
52
    {
53
        return $this->belongsTo(TournamentTeam::class, 'tournamentTeamId');
54
    }
55
}
56