/** * @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; }
/** * @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; } } }