public function LoguearUsuario($email, $password) { try { UsuarioLogica::ValidarEmail($email); UsuarioLogica::ValidarPassword($password); //busco el usuario, si no lo encuentro tiro una exception $this->user = $this->ul . Buscar($email, $password); if (is_null($this->user)) { throw new LoginException("Nombre de Usuario o Contraseña Incorrecta"); } } catch (\Exception $e) { $user = null; throw new LoginException($e->getMessage()); } return $this->user; }
protected function validarGeneral() { UsuarioLogica::ValidarEmail($this->getEmail()); UsuarioLogica::ValidarPassword($this->getPassword()); if (is_null($this->Nombre) || empty($this->Nombre)) { throw new \Exception("El usuario debe tener un nombre\n"); } if (is_null($this->Apellido) || empty($this->Apellido)) { throw new \Exception("El usuario debe tener un apellido\n"); } if (is_null($this->Nro_doc) || empty($this->Nro_doc)) { throw new \Exception("El usuario debe tener un nro de documento\n"); } if (is_null($this->tipo_doc) || empty($this->tipo_doc)) { throw new \Exception("El usuario debe tener un tipo de documento\n"); } }