Completed
Pull Request — develop (#22)
by
unknown
02:30
created

File::item()   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 namespace Modules\Media\Entities;
2
3
use Dimsav\Translatable\Translatable;
4
use Illuminate\Database\Eloquent\Model;
5
6
class File extends Model
7
{
8
    use Translatable;
9
10
    protected $table = 'media__files';
11
    public $translatedAttributes = ['description', 'alt_attribute', 'keywords'];
12
    protected $fillable = [
13
        'description',
14
        'alt_attribute',
15
        'keywords',
16
        'filename',
17
        'path',
18
        'extension',
19
        'mimetype',
20
        'width',
21
        'height',
22
        'filesize',
23
        'folder_id',
24
    ];
25
    function albums()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
26
    {
27
        return $this->belongsToMany('Modules\Gallery\Entities\Album',  'gallery__album_file');
28
    }
29
    function item()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
30
    {
31
        return $this->hasOne('Modules\Gallery\Entities\item');
32
    }
33
}
34