setNode() 보호된 메소드

Sets current \DOMNode instance.
protected setNode ( DOMElement | DOMText | DOMComment $node ) : Element
$node DOMElement | DOMText | DOMComment
리턴 Element
예제 #1
0
 /**
  * Sets current \DOMElement instance.
  *
  * @param \DOMElement $node A \DOMElement instance
  *
  * @throws \LogicException If given node is not an anchor
  */
 protected function setNode(\DOMElement $node)
 {
     if ('a' !== $node->nodeName and 'area' !== $node->nodeName and 'link' !== $node->nodeName) {
         throw new \LogicException(sprintf('Unable to navigate from a "%s" tag.', $node->nodeName));
     }
     parent::setNode($node);
 }