function __construct(\Ess\M2ePro\Model\ActiveRecord\Component\Parent\Amazon\Factory $amazonFactory, \Ess\M2ePro\Model\Connector\Connection\Response $response, \Ess\M2ePro\Helper\Factory $helperFactory, \Ess\M2ePro\Model\Factory $modelFactory, array $params = array()) { parent::__construct($amazonFactory, $response, $helperFactory, $modelFactory, $params); $listingsProductsIds = array_keys($this->params['products']); /** @var \Ess\M2ePro\Model\ResourceModel\Listing\Product\Collection $listingProductCollection */ $listingProductCollection = $this->amazonFactory->getObject('Listing\\Product')->getCollection(); $listingProductCollection->addFieldToFilter('id', array('in' => $listingsProductsIds)); $this->listingsProducts = $listingProductCollection->getItems(); }
function __construct(\Ess\M2ePro\Model\ActiveRecord\Factory $activeRecordFactory, \Ess\M2ePro\Model\ActiveRecord\Component\Parent\Amazon\Factory $amazonFactory, \Ess\M2ePro\Model\Connector\Connection\Response $response, \Ess\M2ePro\Helper\Factory $helperFactory, \Ess\M2ePro\Model\Factory $modelFactory, array $params = array()) { $this->activeRecordFactory = $activeRecordFactory; parent::__construct($amazonFactory, $response, $helperFactory, $modelFactory, $params); $ordersIds = array(); foreach ($this->params as $update) { if (!isset($update['order_id'])) { throw new \Ess\M2ePro\Model\Exception\Logic('Order ID is not defined.'); } $ordersIds[] = (int) $update['order_id']; } $this->orders = $this->activeRecordFactory->getObject('Order')->getCollection()->addFieldToFilter('id', array('in' => $ordersIds))->getItems(); }