Ejemplo n.º 1
0
 /**
  * Get language
  *
  * @return Newscoop\Entity\Language
  */
 private function getLanguage()
 {
     $id = $this->getRequest()->getParam('language');
     $language = $this->repository->find($id);
     if (empty($language)) {
         $this->_helper->flashMessenger->addMessage(getGS('Language not found.'));
         $this->_forward('index');
     }
     return $language;
 }
Ejemplo n.º 2
0
 /**
  * Get language
  *
  * @return Newscoop\Entity\Language
  */
 private function getLanguage()
 {
     $translator = \Zend_Registry::get('container')->getService('translator');
     $id = (int) $this->getRequest()->getParam('language');
     if (!$id) {
         $this->_helper->flashMessenger(array('error', $translator->trans('Language id not specified', array(), 'languages')));
         $this->_helper->redirector('index');
     }
     $language = $this->repository->findOneBy(array('id' => $id));
     if (empty($language)) {
         $this->_helper->flashMessenger->addMessage($translator->trans('Language not found.', array(), 'languages'));
         $this->_helper->redirector('index');
     }
     return $language;
 }