public function __construct(array $params = array(), array $listingsProducts)
 {
     if (count($listingsProducts) == 0) {
         throw new Exception('Multiple Item Connector has received empty array');
     }
     foreach ($listingsProducts as $listingProduct) {
         if (!$listingProduct instanceof Ess_M2ePro_Model_ListingsProducts) {
             throw new Exception('Multiple Item Connector has received invalid product data type');
         }
     }
     $tempListing = $listingsProducts[0]->getListing();
     foreach ($listingsProducts as $listingProduct) {
         if ($tempListing->getId() != $listingProduct->getListing()->getId()) {
             throw new Exception('Multiple Item Connector has received products from different listings');
         }
     }
     $this->listingsProducts = $listingsProducts;
     parent::__construct($params, $tempListing);
 }
Ejemplo n.º 2
0
 public function __construct(array $params = array(), Ess_M2ePro_Model_ListingsProducts $listingProduct)
 {
     $this->listingProduct = $listingProduct;
     parent::__construct($params, $this->listingProduct->getListing());
 }