Exemplo n.º 1
0
 /**
  * Search for Items
  *
  * @param  array $options Options to use for the Search Query
  * @throws Zend_Service_Exception
  * @return Kwf_Service_Amazon_ResultSet
  * @see http://www.amazon.com/gp/aws/sdk/main.html/102-9041115-9057709?s=AWSEcommerceService&v=2011-08-01&p=ApiReference/ItemSearchOperation
  */
 public function itemSearch(array $options)
 {
     Kwf_Benchmark::countBt('Service Amazon request', 'itemSearch' . print_r($options, true));
     $client = $this->getRestClient();
     $client->setUri($this->_baseUri);
     $defaultOptions = array('ResponseGroup' => 'Small');
     $options = $this->_prepareOptions('ItemSearch', $options, $defaultOptions);
     $client->getHttpClient()->resetParameters();
     $response = $client->restGet('/onca/xml', $options);
     if ($response->isError()) {
         /**
          * @see Zend_Service_Exception
          */
         throw new Zend_Service_Exception('An error occurred sending request. Status code: ' . $response->getStatus());
     }
     $dom = new DOMDocument();
     $dom->loadXML($response->getBody());
     self::_checkErrors($dom);
     return new Kwf_Service_Amazon_ResultSet($dom);
 }