Completed
Push — master ( 509012...3eafe2 )
by David
02:34
created

Page   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A detail() 0 4 1
A template() 0 4 1
1
<?php namespace App\LaravelRestCms\Page;
2
3
use App\LaravelRestCms\BaseModel;
4
use App\LaravelRestCms\Page\PageDetail;
5
use App\LaravelRestCms\Template\Template;
6
7
class Page extends BaseModel {
8
9
	public static $searchCols = ['nav_name', 'url', 'title'];
10
11
	/**
12
	 * The database table used by the model.
13
	 *
14
	 * @var string
15
	 */
16
	protected $table = 'pages';
17
18
	/**
19
	 * The attributes that are mass assignable.
20
	 *
21
	 * @var array
22
	 */
23
	protected $fillable = [];
24
25
	/**
26
	 * The attributes excluded from the model's JSON form.
27
	 *
28
	 * @var array
29
	 */
30
	protected $hidden = [];
31
32
	/**
33
	 * Joins the page_detail table
34
	 * 
35
	 * @return \Illuminate\Database\Eloquent\Relations\HasMany
36
	 */
37
	public function detail()
38
    {
39
        return $this->hasMany(PageDetail::class, 'page_id', 'id');
40
    }
41
42
	/**
43
	 * Joins the templates table
44
	 * 
45
	 * @return \Illuminate\Database\Eloquent\Relations\hasOne
46
	 */
47
	public function template()
48
    {
49
        return $this->hasMany(Template::class, 'id', 'template_id');
50
    }
51
52
}
53