src/Titon/Db/Behavior/HierarchyBehavior.php
protected function _removeNode($id, $index) {
        $pk = $this->getRepository()->getPrimaryKey();

        foreach ([$this->getConfig('leftField'), $this->getConfig('rightField')] as $field) {
            $this->_moveNode(function(Query $query) use ($field, $index, $id, $pk) {
                $query->where($field, '>=', $index);

                if ($id) {
                    $query->where($pk, '!=', $id);
                }
            }, [
                $field => Query::expr($field, '-', 2)
            ]);
        }
    }
protected function _removeNode($id, $index) {
        $pk = $this->getRepository()->getPrimaryKey();

        foreach ([$this->getConfig('leftField'), $this->getConfig('rightField')] as $field) {
            $this->_moveNode(function(Query $query) use ($field, $index, $id, $pk) {
                $query->where($field, '>=', $index);

                if ($id) {
                    $query->where($pk, '!=', $id);
                }
            }, [
                $field => Query::expr($field, '-', 2)
            ]);
        }
    }
protected function _removeNode ( $ id , $ index ) { $ pk = $ this -> getRepository ( ) -> getPrimaryKey ( ) ; foreach ( [ $ this -> getConfig ( 'leftField' ) , $ this -> getConfig ( 'rightField' ) ] as $ field ) { $ this -> _moveNode ( function ( Query $ query ) use ( $ field , $ index , $ id , $ pk ) { $ query -> where ( $ field , '>=' , $ index ) ; if ( $ id ) { $ query -> where ( $ pk , '!=' , $ id ) ; } } , [ $ field => Query :: expr ( $ field , '-' , 2 ) ] ) ; } }
Prepares a node for removal by moving all following nodes up.

@param int $id
@param int $index
Prepares a node for removal by moving all following nodes up .