public function nextNodeSibling($nID)
    {
        //if ($nID == $this->tree->TreeLastPage) return -37;
        if (!$this->hasNode($nID) || $this->allNodes[$nID]->parentID <= 0) {
            return -3;
        }
        $nodeOverride = $this->moveNextOverride($nID);
        if ($nodeOverride > 0) {
            return $nodeOverride;
        }
        $nextSibling = SLNode::where('NodeTree', $this->treeID)
            ->where('NodeParentID', $this->allNodes[$nID]->parentID)
            ->where('NodeParentOrder', (1+$this->allNodes[$nID]->parentOrd))
            ->select('NodeID')
            ->first();
        if ($nextSibling && isset($nextSibling->NodeID)) {
            return $nextSibling->NodeID;
        }
        return $this->nextNodeSibling($this->allNodes[$nID]->parentID);
    }
public function nextNodeSibling($nID)
    {
        //if ($nID == $this->tree->TreeLastPage) return -37;
        if (!$this->hasNode($nID) || $this->allNodes[$nID]->parentID <= 0) {
            return -3;
        }
        $nodeOverride = $this->moveNextOverride($nID);
        if ($nodeOverride > 0) {
            return $nodeOverride;
        }
        $nextSibling = SLNode::where('NodeTree', $this->treeID)
            ->where('NodeParentID', $this->allNodes[$nID]->parentID)
            ->where('NodeParentOrder', (1+$this->allNodes[$nID]->parentOrd))
            ->select('NodeID')
            ->first();
        if ($nextSibling && isset($nextSibling->NodeID)) {
            return $nextSibling->NodeID;
        }
        return $this->nextNodeSibling($this->allNodes[$nID]->parentID);
    }
public function nextNodeSibling ( $ nID ) { //if ($nID == $this->tree->TreeLastPage) return -37; if ( ! $ this -> hasNode ( $ nID ) || $ this -> allNodes [ $ nID ] -> parentID <= 0 ) { return - 3 ; } $ nodeOverride = $ this -> moveNextOverride ( $ nID ) ; if ( $ nodeOverride > 0 ) { return $ nodeOverride ; } $ nextSibling = SLNode :: where ( 'NodeTree' , $ this -> treeID ) -> where ( 'NodeParentID' , $ this -> allNodes [ $ nID ] -> parentID ) -> where ( 'NodeParentOrder' , ( 1 + $ this -> allNodes [ $ nID ] -> parentOrd ) ) -> select ( 'NodeID' ) -> first ( ) ; if ( $ nextSibling && isset ( $ nextSibling -> NodeID ) ) { return $ nextSibling -> NodeID ; } return $ this -> nextNodeSibling ( $ this -> allNodes [ $ nID ] -> parentID ) ; }
Locate the next node, outside this node's descendants
Locate the next node outside this node s descendants