Exemple #1
0
 /**
  * @return \Mirasvit\Blog\Model\Category
  */
 public function initModel()
 {
     $model = $this->categoryFactory->create();
     if ($this->getRequest()->getParam('id')) {
         $model->load($this->getRequest()->getParam('id'));
     }
     $this->registry->register('current_model', $model);
     return $model;
 }
Exemple #2
0
 /**
  * @return \Mirasvit\Blog\Model\Category
  */
 protected function initCategory()
 {
     if ($id = $this->getRequest()->getParam('id')) {
         $post = $this->categoryFactory->create()->load($id);
         if ($post->getId() > 0) {
             $this->registry->register('current_blog_category', $post);
             return $post;
         }
     }
 }