concrete/src/Tree/Node/Node.php
public function checkMove(Node $newParent)
    {
        $result = null;
        if ($this->getTreeNodeParentID() != $newParent->getTreeNodeID()) {
            if ($this->getTreeNodeID() == $newParent->getTreeNodeID()) {
                $result = new MoveException(t("It's not possible to move a node under itself"));
            } else {
                foreach ($newParent->getTreeNodeParentArray() as $newParentAncestor) {
                    if ($newParentAncestor->getTreeNodeID() == $this->getTreeNodeID()) {
                        $result = MoveException(t("It's not possible to move a node under one of its descending nodes"));
                        break;
                    }
                }
            }
        }

        return $result;
    }
public function checkMove(Node $newParent)
    {
        $result = null;
        if ($this->getTreeNodeParentID() != $newParent->getTreeNodeID()) {
            if ($this->getTreeNodeID() == $newParent->getTreeNodeID()) {
                $result = new MoveException(t("It's not possible to move a node under itself"));
            } else {
                foreach ($newParent->getTreeNodeParentArray() as $newParentAncestor) {
                    if ($newParentAncestor->getTreeNodeID() == $this->getTreeNodeID()) {
                        $result = MoveException(t("It's not possible to move a node under one of its descending nodes"));
                        break;
                    }
                }
            }
        }

        return $result;
    }
public function checkMove ( Node $ newParent ) { $ result = null ; if ( $ this -> getTreeNodeParentID ( ) != $ newParent -> getTreeNodeID ( ) ) { if ( $ this -> getTreeNodeID ( ) == $ newParent -> getTreeNodeID ( ) ) { $ result = new MoveException ( t ( "It's not possible to move a node under itself" ) ) ; } else { foreach ( $ newParent -> getTreeNodeParentArray ( ) as $ newParentAncestor ) { if ( $ newParentAncestor -> getTreeNodeID ( ) == $ this -> getTreeNodeID ( ) ) { $ result = MoveException ( t ( "It's not possible to move a node under one of its descending nodes" ) ) ; break ; } } } } return $ result ; }
Check if this node can be moved under another parent.

@param Node $newParent the new parent node

@return MoveException|null return a MoveException in case of problems, null in case of success
Check if this node can be moved under another parent .