示例#1
0
 /**
  * action
  *
  * @return void
  *
  */
 public function listAction()
 {
     if ($authorID = $GLOBALS['TSFE']->fe_user->user['uid']) {
         //            $author = $this->objectManager->get('Vendor\\Guestbook\\Domain\\Repository\\AuthorRepository')->findOneByUid($authorID);
         $author = $this->authorRepository->findByUid($authorID);
         $this->view->assign('author', $author);
     }
     $this->view->assign('comments', $this->commentRepository->findAll());
 }
示例#2
0
 /**
  * Activate the author - activate the author: switch disable -> 0
  *
  * @param string $author
  */
 public function activateAction($author)
 {
     /** @var \Vendor\Guestbook\Domain\Model\Author $author */
     $author = $this->authorRepository->findByUid((int) $author);
     if ($author->getDisable() == 0) {
         $this->redirect('list', 'Comment', NULL, NULL);
     }
     $author->setDisable(0);
     $this->authorRepository->update($author);
     $this->view->assign('author', $author);
 }