Node   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A topics() 0 4 1
A getPresenterClass() 0 4 1
1
<?php
2
3
namespace PHPHub;
4
5
use McCool\LaravelAutoPresenter\HasPresenter;
6
use PHPHub\Presenters\NodePresenter;
7
use Illuminate\Database\Eloquent\Model;
8
9
class Node extends Model implements HasPresenter
10
{
11
    public static $includable = ['id', 'name', 'slug', 'parent_node', 'description'];
12
    protected $fillable = [];
13
14
    protected $casts = [
15
        'id'          => 'int',
16
        'parent_node' => 'int',
17
    ];
18
19
    public function topics()
20
    {
21
        return $this->hasMany(Topic::class);
22
    }
23
24
    /**
25
     * Get the presenter class.
26
     *
27
     * @return string
28
     */
29
    public function getPresenterClass()
30
    {
31
        return NodePresenter::class;
32
    }
33
}
34