File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,9 @@ public function toTree($root = null)
7777 */
7878 protected function getRootNodeId ($ root = null )
7979 {
80- if ($ root instanceof Node) return $ root ->getKey ();
80+ if (NodeTrait::hasTrait ($ root )) {
81+ return $ root ->getKey ();
82+ }
8183
8284 // If root node is not specified we take parent id of node with
8385 // least lft value as root node id.
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ public function whereAncestorOf($id)
8484
8585 $ key = $ this ->query ->getGrammar ()->wrap ($ keyName );
8686
87- if ($ id instanceof Node )
87+ if (NodeTrait:: hasTrait ( $ id) )
8888 {
8989 $ dataSource = '? ' ;
9090
@@ -167,7 +167,7 @@ public function orWhereNodeBetween($values)
167167 */
168168 public function whereDescendantOf ($ id , $ boolean = 'and ' , $ not = false )
169169 {
170- if ($ id instanceof Node )
170+ if (NodeTrait:: hasTrait ( $ id) )
171171 {
172172 $ data = $ id ->getBounds ();
173173 }
You can’t perform that action at this time.
0 commit comments