public function setLargeImageUrl($largeImageUrl)
 {
     $this->__load();
     return parent::setLargeImageUrl($largeImageUrl);
 }
Exemple #2
0
 public static function mapFromAmazonResult(\Sb\Db\Model\Book &$book, \Zend_Service_Amazon_Item $amazonResult)
 {
     if (isset($amazonResult->Language)) {
         $book->setLanguage($amazonResult->Language);
     }
     if (isset($amazonResult->Author)) {
         $contributors = new \Doctrine\Common\Collections\ArrayCollection();
         if (is_array($amazonResult->Author)) {
             foreach ($amazonResult->Author as $author) {
                 $contributor = new \Sb\Db\Model\Contributor();
                 $contributor->setFullName($author);
                 $contributors->add($contributor);
             }
         } else {
             $contributor = new \Sb\Db\Model\Contributor();
             $contributor->setFullName($amazonResult->Author);
             $contributors->add($contributor);
         }
         $book->setContributors($contributors);
     }
     if (isset($amazonResult->EditorialReviews)) {
         if (count($amazonResult->EditorialReviews) > 0) {
             //$book->setDescription($amazonResult->EditorialReviews[0]->Content);
             // Replace all HTML in description by ' ' to prevent bad formatting HTML
             $book->setDescription(preg_replace('/<[^>]*>/', ' ', $amazonResult->EditorialReviews[0]->Content));
         }
     }
     if (isset($amazonResult->ISBN)) {
         $book->setISBN10($amazonResult->ISBN);
     }
     if (isset($amazonResult->EAN)) {
         $book->setISBN13($amazonResult->EAN);
     }
     if (isset($amazonResult->ASIN)) {
         $book->setASIN($amazonResult->ASIN);
     }
     if (isset($amazonResult->SmallImage)) {
         if ($amazonResult->SmallImage && $amazonResult->SmallImage->Url) {
             $book->setSmallImageUrl($amazonResult->SmallImage->Url->getUri());
         }
     }
     if (isset($amazonResult->MediumImage)) {
         if ($amazonResult->MediumImage && $amazonResult->MediumImage->Url) {
             $book->setImageUrl($amazonResult->MediumImage->Url->getUri());
         }
     }
     if (isset($amazonResult->LargeImage)) {
         if ($amazonResult->LargeImage && $amazonResult->LargeImage->Url) {
             $book->setLargeImageUrl($amazonResult->LargeImage->Url->getUri());
         }
     }
     //Publisher
     if (isset($amazonResult->PublicationDate)) {
         $book->setPublishingDate(\Sb\Helpers\DateHelper::createDate($amazonResult->PublicationDate));
     }
     if (isset($amazonResult->Publisher)) {
         $publisher = new \Sb\Db\Model\Publisher();
         $publisher->setName($amazonResult->Publisher);
         $book->setPublisher($publisher);
     }
     if (isset($amazonResult->Title)) {
         $book->setTitle($amazonResult->Title);
     }
     if (isset($amazonResult->DetailPageURL)) {
         $book->setAmazonUrl($amazonResult->DetailPageURL);
     }
     if (isset($amazonResult->NumberOfPages)) {
         $book->setNb_of_pages($amazonResult->NumberOfPages);
     }
 }