コード例 #1
0
ファイル: Item.php プロジェクト: harz87/Amazon-Affialiate
 public function __construct($dom)
 {
     try {
         parent::__construct($dom);
     } catch (Exception $exc) {
         throw new $exc();
     }
     $xpath = new DOMXPath($dom->ownerDocument);
     $xpath->registerNamespace('az', 'http://webservices.amazon.com/AWSECommerceService/2005-10-05');
     $result = $xpath->query('./az:Offers', $dom);
     $resultSummary = $xpath->query('./az:OfferSummary', $dom);
     if ($result->length > 1 || $resultSummary->length == 1) {
         $this->Offers = new Zend_clicks_Service_Amazon_OfferSet($dom);
     }
     foreach (array('SmallImage', 'MediumImage', 'LargeImage') as $im) {
         $result = $xpath->query("./az:ImageSets/az:ImageSet[@Category='variant']/az:{$im}", $dom);
         $this->images[$im] = array();
         for ($i = 0; $i < $result->length; $i++) {
             /**
              * @see Zend_Service_Amazon_Image
              */
             require_once 'Zend/Service/Amazon/Image.php';
             $this->images[$im][$i] = new Zend_Service_Amazon_Image($result->item($i));
         }
     }
 }
コード例 #2
0
 public function __construct(DOMElement $dom)
 {
     parent::__construct($dom);
     $xpath = new DOMXPath($dom->ownerDocument);
     $xpath->registerNamespace('az', 'http://webservices.amazon.com/AWSECommerceService/2011-08-01');
     $result = $xpath->query('./az:BrowseNodes/az:BrowseNode', $dom);
     if ($result->length >= 1) {
         $this->BrowseNodes = array();
         foreach ($result as $v) {
             $r = $xpath->query('./az:BrowseNodeId/text()', $v);
             $this->BrowseNodes[] = (string) $r->item(0)->data;
         }
     }
 }