public function setChild(self $node)
    {
        $this->removeChildrenOfType($node->getNodeType());

        return $this->addChild($node);
    }
public function setChild(self $node)
    {
        $this->removeChildrenOfType($node->getNodeType());

        return $this->addChild($node);
    }
public function setChild ( self $ node ) { $ this -> removeChildrenOfType ( $ node -> getNodeType ( ) ) ; return $ this -> addChild ( $ node ) ; }
Remove any previous children and add
given node via. addChild.

@see removeChildrenOfType
@see addChild

@param AbstractNode $node

@return AbstractNode
Remove any previous children and add given node via . addChild .