/** * @param \Magento\Store\Model\Website $subject * @param \Magento\Store\Model\Store $store * @return \Magento\Store\Model\Store */ public function afterGetDefaultStore(Website $subject, Store $store) { if ($this->generalConfig->isAvailable() && $this->storeSwitcher->isInitialized()) { $storeId = $this->storeSwitcher->getStoreId(); if ($store->getId() != $storeId && in_array($storeId, $subject->getStoreIds())) { $store = $this->storeRepository->getById($storeId); } } return $store; }
/** * {@inheritdoc} */ public function getStoreIds() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getStoreIds'); if (!$pluginInfo) { return parent::getStoreIds(); } else { return $this->___callPlugins('getStoreIds', func_get_args(), $pluginInfo); } }
public function testGetStoreIds() { $this->assertEquals(array(1 => 1), $this->_model->getStoreIds()); }
public function testGetStoreIds() { $this->assertEquals([1 => 1], $this->_model->getStoreIds()); }
/** * Get reviews for export. * * @param \Magento\Store\Model\Website $website * @param int $limit * * @return mixed */ public function _getReviewsToExport(\Magento\Store\Model\Website $website, $limit = 100) { return $this->reviewCollection->create()->addFieldToFilter('review_imported', ['null' => 'true'])->addFieldToFilter('store_id', ['in' => $website->getStoreIds()])->setPageSize($limit); }
/** * Get wishlists marked as modified for website. * * @param \Magento\Store\Model\Website $website * @param int $limit * * @return mixed */ public function getModifiedWishlistToImport(\Magento\Store\Model\Website $website, $limit = 100) { $collection = $this->wishlistCollection->create()->addFieldToFilter('wishlist_modified', 1)->addFieldToFilter('store_id', ['in' => $website->getStoreIds()]); $collection->getSelect()->limit($limit); return $collection; }
/** * Contact subscribers to import for website. * * @param \Magento\Store\Model\Website $website * @param int $limit * * @return $this */ public function getSubscribersToImport(\Magento\Store\Model\Website $website, $limit = 1000) { $storeIds = $website->getStoreIds(); $collection = $this->getCollection()->addFieldToFilter('is_subscriber', ['notnull' => true])->addFieldToFilter('subscriber_status', '1')->addFieldToFilter('subscriber_imported', ['null' => true])->addFieldToFilter('store_id', ['in' => $storeIds]); $collection->getSelect()->limit($limit); return $collection; }