示例#1
0
 /**
  * Get user for given id
  *
  * @return Newscoop\Entity\User
  */
 protected function getUser()
 {
     $id = $this->_getParam('user', false);
     if (!$id) {
         $this->_helper->flashMessenger(array('error', getGS('User id not specified')));
         $this->_helper->redirector('index');
     }
     $user = $this->userService->find($id);
     if (empty($user)) {
         $this->_helper->flashMessenger(array('error', getGS("User with id '\$1' not found", $id)));
         $this->_helper->redirector('index');
     }
     return $user;
 }
示例#2
0
 /**
  * Get user for given id
  *
  * @return Newscoop\Entity\User
  */
 protected function getUser()
 {
     $translator = \Zend_Registry::get('container')->getService('translator');
     $id = (int) $this->_getParam('user', false);
     if (!$id) {
         $this->_helper->flashMessenger(array('error', $translator->trans('User id not specified', array(), 'users')));
         $this->_helper->redirector('index');
     }
     $user = $this->userService->find($id);
     if (empty($user)) {
         $this->_helper->flashMessenger(array('error', $translator->trans("User with id \$1 not found", array('$1' => $id), 'users')));
         $this->_helper->redirector('index');
     }
     return $user;
 }
示例#3
0
 public function testDeletePending()
 {
     $user = $this->service->createPending('*****@*****.**');
     $this->service->delete($user);
     $this->assertEmpty($this->service->find($user->getId()));
 }