/** * @return \Zend\View\Model\ViewModel */ public function listAction() { $slug = $this->params('slug'); $page = $this->params('page'); $category = $this->categoryRepository->findBySlug($slug); return new ViewModel(array('category' => $category, 'posts' => $this->postRepository->findByCategoryPaginated($category, $page))); }
/** * @param $slug */ public function delete($slug) { $this->objectManager->remove($this->repository->findBySlug($slug)); $this->objectManager->flush(); }
/** * @return \Zend\View\Model\ViewModel */ public function viewAction() { $slug = $this->params('slug'); $post = $this->repository->findBySlug($slug); return new ViewModel(array('post' => $post)); }
/** * (non-PHPDoc) * @see Rhapsody\SocialBundle\Doctrine\CategoryManagerInterface::findBySlug() */ public function findBySlug($slug) { return $this->repository->findBySlug($slug); }