/** * Method for saving a banned * * @param ZendForm $p_form * @param Newscoop\Entity\Comment\Commenter $p_commenter */ private function handleBanForm(Admin_Form_Ban $p_form, $p_commenter, $p_publication) { if ($this->getRequest()->isPost() && $p_form->isValid($_POST)) { if ($p_form->getSubmit()->isChecked()) { $values = $p_form->getValues(); $this->acceptanceRepository->saveBanned($p_commenter, $p_publication, $values); $this->acceptanceRepository->flush(); $this->_helper->flashMessenger(getGS('Ban for commenter "$1" saved.', $p_commenter->getName())); if ($p_form->getDeleteComments()->isChecked()) { $this->commenterRepository->delete($p_commenter, $p_form->getValues()); $this->commenterRepository->flush(); } } $this->_helper->redirector->gotoSimple('index', 'comment'); } }
/** * Method for saving a banned * * @param ZendForm $p_form * @param Newscoop\Entity\Comment\Commenter $p_commenter */ private function handleBanForm(Admin_Form_Ban $p_form, $p_commenter, $p_publication) { $translator = \Zend_Registry::get('container')->getService('translator'); if ($this->getRequest()->isPost() && $p_form->isValid($_POST)) { if ($p_form->getSubmit()->isChecked()) { $values = $p_form->getValues(); $this->acceptanceRepository->saveBanned($p_commenter, $p_publication, $values); $this->acceptanceRepository->flush(); $this->_helper->flashMessenger($translator->trans('Ban for commenter $1 saved.', array('$1' => $p_commenter->getName()), 'comments')); if ($p_form->getDeleteComments()->isChecked()) { $this->commenterRepository->delete($p_commenter, $p_form->getValues()); $this->commenterRepository->flush(); } } $this->_helper->redirector->gotoSimple('index', 'comments'); } }