1 | <?php namespace Arcanedev\LaravelNestedSet\Eloquent; |
||
13 | class Collection extends EloquentCollection |
||
14 | { |
||
15 | /* ------------------------------------------------------------------------------------------------ |
||
16 | | Main Functions |
||
17 | | ------------------------------------------------------------------------------------------------ |
||
18 | */ |
||
19 | /** |
||
20 | * Fill `parent` and `children` relationships for every node in the collection. |
||
21 | * |
||
22 | * This will overwrite any previously set relations. |
||
23 | * |
||
24 | * @return \Arcanedev\LaravelNestedSet\Eloquent\Collection |
||
25 | */ |
||
26 | 20 | public function linkNodes() |
|
50 | |||
51 | /** |
||
52 | * Build a tree from a list of nodes. Each item will have set children relation. |
||
53 | * To successfully build tree "id", "_lft" and "parent_id" keys must present. |
||
54 | * If `$root` is provided, the tree will contain only descendants of that node. |
||
55 | * |
||
56 | * @param mixed $root |
||
57 | * |
||
58 | * @return \Arcanedev\LaravelNestedSet\Eloquent\Collection |
||
59 | */ |
||
60 | 20 | public function toTree($root = false) |
|
78 | |||
79 | /** |
||
80 | * Build a list of nodes that retain the order that they were pulled from the database. |
||
81 | * |
||
82 | * @param bool $root |
||
83 | * |
||
84 | * @return \Arcanedev\LaravelNestedSet\Eloquent\Collection |
||
85 | */ |
||
86 | public function toFlatTree($root = false) |
||
97 | |||
98 | /* ------------------------------------------------------------------------------------------------ |
||
99 | | Other Functions |
||
100 | | ------------------------------------------------------------------------------------------------ |
||
101 | */ |
||
102 | /** |
||
103 | * Get root node id. |
||
104 | * |
||
105 | * @param mixed $root |
||
106 | * |
||
107 | * @return int |
||
108 | */ |
||
109 | 20 | protected function getRootNodeId($root = false) |
|
131 | |||
132 | /** |
||
133 | * Flatten a tree into a non recursive array. |
||
134 | * |
||
135 | * @param \Arcanedev\LaravelNestedSet\Eloquent\Collection $groupedNodes |
||
136 | * @param mixed $parentId |
||
137 | * |
||
138 | * @return \Arcanedev\LaravelNestedSet\Eloquent\Collection |
||
139 | */ |
||
140 | protected function flattenTree(self $groupedNodes, $parentId) |
||
149 | } |
||
150 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: