diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/Service/Yahoo/Result.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Service/Yahoo/Result.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,126 @@ +_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; + } + } +}