Completed
Push — master ( ab345e...8b711d )
by CodexShaper
13:15
created

DBM_MongoMenuItem   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 31
rs 10
ccs 0
cts 11
cp 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A settings() 0 3 1
A childrens() 0 3 1
A children() 0 3 1
1
<?php
2
3
namespace CodexShaper\DBM\Models;
4
5
use CodexShaper\DBM\Traits\Relationships;
6
use Jenssegers\Mongodb\Eloquent\Model;
0 ignored issues
show
Bug introduced by
The type Jenssegers\Mongodb\Eloquent\Model was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
class DBM_MongoMenuItem extends Model
9
{
10
    use Relationships;
11
    
12
    protected $collection = 'menu_items';
13
    //
14
    protected $fillable = [
15
        'title', 
16
        'slug', 
17
        'order', 
18
        'parent_id',
19
    ];
20
21
    protected $cast = [
22
        'params' => 'array', 
23
    ];
24
25
    public function children()
26
    {
27
        return $this->hasMany(self::class, 'parent_id')->orderBy('order', 'asc');
28
    }
29
30
    // recursive, loads all descendants
31
    public function childrens()
32
    {
33
        return $this->children()->with('childrens');
34
    }
35
36
    public function settings()
37
    {
38
        return $this->hasMany(MenuSetting::class, 'menu_id');
0 ignored issues
show
Bug introduced by
The type CodexShaper\DBM\Models\MenuSetting was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
39
    }
40
}
41