Reference::fields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Finder\Models;
4
5
use Pedreiro\Models\Base;
6
use Fabrica\Models\Code\Issue;
7
use Fabrica\Models\Code\Field;
8
use Fabrica\Models\Code\Project;
9
10
class Reference extends Base
11
{
12
13
    protected $organizationPerspective = false;
14
15
    protected $table = 'references';
16
17
    public $timestamps = false;
18
19
    /**
20
     * The attributes that are mass assignable.
21
     *
22
     * @var array
23
     */
24
    protected $fillable = [
25
        'code',
26
        'name',
27
    ];
28
29
30
    /**
31
     * Get all of the issues that are assigned this reference.
32
     */
33
    public function issues()
34
    {
35
        return $this->morphedByMany(Issue::class)->withPivot('identify');
36
    }
37
38
39
    /**
40
     * Get all of the fields that are assigned this reference.
41
     */
42
    public function fields()
43
    {
44
        return $this->morphedByMany(Field::class)->withPivot('identify');
45
    }
46
47
    /**
48
     * Get all of the projects that are assigned this reference.
49
     */
50
    public function projects()
51
    {
52
        return $this->morphedByMany(Project::class)->withPivot('identify');
53
    }
54
    
55
}