Total Complexity | 9 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 9 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | trait HasRecursiveRelationships |
||
10 | { |
||
11 | use HasAdjacencyList; |
||
12 | use QueriesExpressions; |
||
13 | |||
14 | public function isParentOf(Model $model) |
||
15 | { |
||
16 | if (!$this->relationLoaded('children')) { |
||
|
|||
17 | $this->load('children'); |
||
18 | } |
||
19 | return $this->children ? $this->children->contains($model) : false; |
||
20 | } |
||
21 | |||
22 | public function isChildOf(Model $model) |
||
28 | } |
||
29 | |||
30 | public function depthRelatedTo(Model $model) |
||
41 | } |
||
42 | } |
||
43 |