public function registerAction()
 {
     $request = $this->getRequest();
     $userRegisterForm = new UserRegisterForm();
     if ($request->isPost()) {
         $user = new User();
         $user->setUserLogin($request->getPost('user_login'));
         $user->setUserName($request->getPost('user_name'));
         $user->setUserEmail($request->getPost('user_email'));
         $user->setUserPassword(md5($request->getPost('user_password')));
         $user->setUserIp($_SERVER['REMOTE_ADDR']);
         $user->setUserRegisterDate(new \DateTime('now'));
         $user->setUserProfile(1);
         $userRegisterForm->setInputFilter($user->getInputFilter());
         $userRegisterForm->setData($request->getPost());
         if ($userRegisterForm->isValid()) {
             $this->getEntityManager()->persist($user);
             $this->getEntityManager()->flush();
             $this->flashMessenger()->addInfoMessage("Seu cadastrado foi realizado com sucesso, " . $request->getPost('user_name'));
             return $this->redirect()->toRoute('users-login');
         }
         $this->flashMessenger()->addFlashMessage("Falha no Cadastro.");
         $this->redirect()->toRoute('users-login');
     }
     return new ViewModel(array('userRegisterForm' => $userRegisterForm));
 }
 /**
  * {@inheritDoc}
  */
 public function setUserIp($userIp)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setUserIp', array($userIp));
     return parent::setUserIp($userIp);
 }