_fields = array_merge($this->_fields, $fields); $this->_xpath = new DOMXPath($result->ownerDocument); $this->_xpath->registerNamespace('yh', $this->_namespace); // add search results to appropriate fields foreach ($this->_fields as $f) { $query = "./yh:$f/text()"; $node = $this->_xpath->query($query, $result); if ($node->length == 1) { $this->{$f} = $node->item(0)->data; } } $this->_result = $result; } /** * Sets the Thumbnail property * * @return void */ protected function _setThumbnail() { $node = $this->_xpath->query('./yh:Thumbnail', $this->_result); if ($node->length == 1) { /** * @see Zend_Service_Yahoo_Image */ #require_once 'Zend/Service/Yahoo/Image.php'; $this->Thumbnail = new Zend_Service_Yahoo_Image($node->item(0), $this->_namespace); } else { $this->Thumbnail = null; } } }