Symfony\Component\DomCrawler\Crawler::image PHP 메소드

image() 공개 메소드

Returns an Image object for the first node in the list.
public image ( ) : Symfony\Component\DomCrawler\Image
리턴 Symfony\Component\DomCrawler\Image An Image instance
    public function image()
    {
        if (!count($this)) {
            throw new \InvalidArgumentException('The current node list is empty.');
        }
        $node = $this->getNode(0);
        if (!$node instanceof \DOMElement) {
            throw new \InvalidArgumentException(sprintf('The selected node should be instance of DOMElement, got "%s".', get_class($node)));
        }
        return new Image($node, $this->baseHref);
    }