Note::attachments()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace SET;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Note extends Model
8
{
9
    protected $table = 'notes';
10
    public $timestamps = true;
11
12
    protected $fillable = ['user_id', 'author_id', 'private', 'alert',
13
        'comment', 'title', ];
14
15
    public function user()
16
    {
17
        return $this->belongsTo('SET\User');
18
    }
19
20
    public function author()
21
    {
22
        return $this->belongsTo('SET\User', 'author_id');
23
    }
24
25
    public function attachments()
26
    {
27
        return $this->morphMany('SET\Attachment', 'imageable');
28
    }
29
30
    public function training()
31
    {
32
        return $this->belongsTo('SET\Training');
33
    }
34
}
35