|
|
|
@ -43,6 +43,9 @@ class UsuarioModel implements Model
|
|
|
|
|
{ |
|
|
|
|
$table = UsuarioModel::$table; |
|
|
|
|
$query = "DELETE FROM $table WHERE matricula = :matricula"; |
|
|
|
|
if (empty($params['matricula'])) { |
|
|
|
|
throw new Exception('Parâmetro matricula é obrigatório'); |
|
|
|
|
} |
|
|
|
|
return $this->db->delete($query, $params); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -60,8 +63,8 @@ class UsuarioModel implements Model
|
|
|
|
|
$table = UsuarioModel::$table; |
|
|
|
|
$query = "UPDATE $table SET nome = :nome, apelido = :apelido WHERE matricula = :matricula"; |
|
|
|
|
if (empty($params['matricula'])) { |
|
|
|
|
throw new Exception('Parametrô matricula é obrigatório'); |
|
|
|
|
throw new Exception('Parâmetro matricula é obrigatório'); |
|
|
|
|
} |
|
|
|
|
return $this->db->update($query, $params); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|