/**
  * Ejecuta un actualizar en la base de datos
  * @param UserDTO $obj 
  * @return void      
  * @author Johnny Alexander Salazar
  * @version 0.1
  */
 public function Update(UserDTO $obj)
 {
     $query = $this->repository->buildQuerySimply("updateuser", array((int) $obj->getId(), (string) $obj->getFirstName(), (string) $obj->getSecondName(), (string) $obj->getFirstLastName(), (string) $obj->getSecondLastName(), (string) $obj->getUser(), (string) md5($obj->getPassword()), (int) $obj->getRol(), (string) $obj->getDescription()));
     $this->repository->ExecuteTransaction($query);
 }
Exemple #2
0
 public function updateUserPassword(\UserDTO $userDTO)
 {
     try {
         $this->userAutentication();
         $set = array(PASSWORD => $userDTO->getPassword());
         $where = array(USERID => $userDTO->getUserId());
         $result = $this->getDB()->update(USER_TABLE, $set, $where);
         return $result;
     } catch (PDOException $pdoe) {
         throw $pdoe;
     } catch (UserNotAuthenticatedExceptionDTO $authExp) {
         throw $authExp;
     } catch (Exception $e) {
         throw $e;
     }
 }