public function execute() { /** * When Magento get your model, it will generate a Factory class * for your model at var/generaton folder and we can get your * model by this way */ $newsModel = $this->_modelManufacturerFactory->create(); $newsCollection = $newsModel->getCollection(); var_dump($newsCollection->getData()); }
/** * Set news collection */ protected function _construct() { parent::_construct(); $collection = $this->_newsFactory->create()->getCollection()->setOrder('id', 'DESC'); $this->setCollection($collection); }