protected function _reOrder($parent_id, $left, array $order = []) {
        $parent = $this->getConfig('parentField');
        $repo = $this->getRepository();
        $pk = $repo->getPrimaryKey();
        $right = $left + 1;

        // Get children and sort
        $children = $repo->select()
            ->where($parent, $parent_id)
            ->orderBy($order)
            ->all();

        foreach ($children as $child) {
            $right = $this->_reOrder($child[$pk], $right, $order);
        }

        // Update parent node
        if ($parent_id) {
            $this->_moveNode(function(Query $query) use ($pk, $parent_id) {
                $query->where($pk, $parent_id);
            }, [
                $this->getConfig('leftField') => $left,
                $this->getConfig('rightField') => $right
            ]);
        }

        return $right + 1;
    }