Photo   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 11
Bugs 0 Features 1
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 36
rs 10
c 11
b 0
f 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A album() 0 4 1
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
}