Photo::album()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 4
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace JeroenG\LaravelPhotoGallery\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
8
class Photo extends Model
9
{
10
    use SoftDeletes;
11
12
    /**
13
     * The table used by this model
14
     *
15
     * @var string
16
     **/
17
    protected $table = 'photos';
18
19
    /**
20
     * The attributes that should be mutated to dates.
21
     *
22
     * @var array
23
     */
24
    protected $dates = ['deleted_at'];
25
26
    /**
27
     * When this model is updated, the updated_at timestamp of the album is also changed
28
     *
29
     * @var array
30
     **/
31
    protected $touches = array('album');
32
33
    /**
34
     * Defining the relationship, a photo belongs to an album
35
     *
36
     * @return \JeroenG\LaravelPhotoGallery\Models\Album
37
     **/
38
    public function album()
39
    {
40
    	return $this->belongsTo('\JeroenG\LaravelPhotoGallery\Models\Album');
41
    }
42
43
}