Exemplo n.º 1
0
 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());
 }
Exemplo n.º 2
0
 /**
  * Set news collection
  */
 protected function _construct()
 {
     parent::_construct();
     $collection = $this->_newsFactory->create()->getCollection()->setOrder('id', 'DESC');
     $this->setCollection($collection);
 }