src/Node/Node.php
public function removeParent(string $parentId, bool $setParentsChild = true): NodeInterface
    {
        if (isset($this->_parents[$parentId])) {
            $parent = $this->getParent($parentId);

            $this->notifySubscribers(
                self::EVENT_REMOVE_PARENT,
                ['oldParents' => $this->_parents, 'parentToRemove' => $parent, 'child' => $this]
            );

            if ($setParentsChild) {
                $parent->removeChild($this->getId(), false);
            }

            unset($this->_parents[$parentId]);
        }

        return $this;
    }
public function removeParent(string $parentId, bool $setParentsChild = true): NodeInterface
    {
        if (isset($this->_parents[$parentId])) {
            $parent = $this->getParent($parentId);

            $this->notifySubscribers(
                self::EVENT_REMOVE_PARENT,
                ['oldParents' => $this->_parents, 'parentToRemove' => $parent, 'child' => $this]
            );

            if ($setParentsChild) {
                $parent->removeChild($this->getId(), false);
            }

            unset($this->_parents[$parentId]);
        }

        return $this;
    }
public function removeParent ( string $ parentId , bool $ setParentsChild = true ) : NodeInterface { if ( isset ( $ this -> _parents [ $ parentId ] ) ) { $ parent = $ this -> getParent ( $ parentId ) ; $ this -> notifySubscribers ( self :: EVENT_REMOVE_PARENT , [ 'oldParents' => $ this -> _parents , 'parentToRemove' => $ parent , 'child' => $ this ] ) ; if ( $ setParentsChild ) { $ parent -> removeChild ( $ this -> getId ( ) , false ) ; } unset ( $ this -> _parents [ $ parentId ] ) ; } return $ this ; }
Removes a parent from this node.

@param string $parentId        - Parent.
@param bool   $setParentsChild - Set parent's child.

@return NodeInterface
Removes a parent from this node .