public function move(Node $newParent)
    {
        $error = $this->checkMove($newParent);
        if ($error !== null) {
            throw $error;
        }
        if ($this->getTreeNodeParentID() != $newParent->getTreeNodeID()) {
            $db = Database::connection();
            $existingDisplayOrder = $this->treeNodeDisplayOrder;
            $treeNodeDisplayOrder = (int) $db->fetchColumn('select count(treeNodeDisplayOrder) from TreeNodes where treeNodeParentID = ?', [$newParent->getTreeNodeID()]);
            $db->executeQuery('update TreeNodes set treeNodeParentID = ?, treeNodeDisplayOrder = ? where treeNodeID = ?', [$newParent->getTreeNodeID(), $treeNodeDisplayOrder, $this->treeNodeID]);
            if (!$this->overrideParentTreeNodePermissions()) {
                $db->executeQuery('update TreeNodes set inheritPermissionsFromTreeNodeID = ? where treeNodeID = ?', [$newParent->getTreeNodePermissionsNodeID(), $this->treeNodeID]);
            }
            $oldParent = $this->getTreeNodeParentObject();
            if (is_object($oldParent)) {
                // Instead of just rescanning all the nodes (which could take a long time),
                // let's just update all the nodes with display order above this one to be their current
                // order - 1
                $db->executeQuery(
                    'update TreeNodes set treeNodeDisplayOrder = (treeNodeDisplayOrder - 1) 
where treeNodeDisplayOrder > ? and treeNodeParentID = ?',
                    [$existingDisplayOrder, $oldParent->getTreeNodeID()]
                );
                //$oldParent->rescanChildrenDisplayOrder();
                $oldParent->updateDateModified();
            }
            $newParent->updateDateModified();
            $this->treeNodeParentID = $newParent->getTreeNodeID();
            $this->treeNodeDisplayOrder = $treeNodeDisplayOrder;
        }
    }