Пример #1
0
 /**
  * @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)));
 }
Пример #2
0
 /**
  * @param $slug
  */
 public function delete($slug)
 {
     $this->objectManager->remove($this->repository->findBySlug($slug));
     $this->objectManager->flush();
 }
Пример #3
0
 /**
  * @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);
 }