_newsFactory = $newsFactory; parent::__construct($context); } public function getLastestNews() { $collection = $this->_newsFactory->create()->getCollection(); $collection->addFieldToFilter('store_ids',array(array('like'=>'%"'.$this->_storeManager->getStore()->getId().'"%'))); $collection->addFieldToFilter('active',1); $collection->setOrder('date_actu','DESC'); return $collection->getFirstItem(); } public function getStoreUrl() { return $this->_storeManager->getStore()->getBaseUrl(); } }