Beispiel #1
0
 /**
  * @return \Mirasvit\Blog\Model\Author
  */
 public function initModel()
 {
     $model = $this->authorFactory->create();
     if ($this->getRequest()->getParam('id')) {
         $model->load($this->getRequest()->getParam('id'));
     }
     $this->registry->register('current_model', $model);
     return $model;
 }
Beispiel #2
0
 /**
  * @return \Mirasvit\Blog\Model\Author
  */
 protected function initModel()
 {
     if ($id = $this->getRequest()->getParam('id')) {
         $author = $this->authorFactory->create()->load($id);
         if ($author->getId() > 0) {
             $this->registry->register('current_blog_author', $author);
             return $author;
         }
     }
     return false;
 }
Beispiel #3
0
 /**
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->authorFactory->create()->getCollection();
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }