Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 protected function _prepareCollection()
 {
     $this->_collection = $this->_queriesFactory->create();
     if ($this->getRequest()->getParam('store')) {
         $storeIds = $this->getRequest()->getParam('store');
     } elseif ($this->getRequest()->getParam('website')) {
         $storeIds = $this->_storeManager->getWebsite($this->getRequest()->getParam('website'))->getStoreIds();
     } elseif ($this->getRequest()->getParam('group')) {
         $storeIds = $this->_storeManager->getGroup($this->getRequest()->getParam('group'))->getStoreIds();
     } else {
         $storeIds = '';
     }
     $this->_collection->setPopularQueryFilter($storeIds);
     $this->setCollection($this->_collection);
     return parent::_prepareCollection();
 }
Esempio n. 2
0
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     $this->_collection = $this->_queriesFactory->create();
     $this->_collection->setRecentQueryFilter();
     if ($this->getRequest()->getParam('store')) {
         $this->_collection->addFieldToFilter('store_id', $this->getRequest()->getParam('store'));
     } elseif ($this->getRequest()->getParam('website')) {
         $storeIds = $this->_storeManager->getWebsite($this->getRequest()->getParam('website'))->getStoreIds();
         $this->_collection->addFieldToFilter('store_id', ['in' => $storeIds]);
     } elseif ($this->getRequest()->getParam('group')) {
         $storeIds = $this->_storeManager->getGroup($this->getRequest()->getParam('group'))->getStoreIds();
         $this->_collection->addFieldToFilter('store_id', ['in' => $storeIds]);
     }
     $this->setCollection($this->_collection);
     return parent::_prepareCollection();
 }