J ai fait le UserGateway (possible qu il lui manque des méthodes), la classe TacheGateway est à refaire(je peut le faire), les problèmes que je rencontre sont :Faut-il l attribut id dans les classe, l attribut mot de passe pour l utilisateur comment hasher et dehasher le mdp et comme faire le frontController! Du coup je poserais des question aux profs! (Si t tout lu t un goat)
parent
7b4d66976a
commit
f2d0dd6e54
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
class UtilisateurGateway{
|
||||||
|
private $con;
|
||||||
|
public function __construct(Connection $con){
|
||||||
|
$this->con=$con;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function CreerUtilisateur(string $nom,string $prenom, string $pseudo, string $email, string $mdp){
|
||||||
|
$query='INSERT INTO ToDoList_Utilisateur(nom,prenom,pseudo,email,motDePasse) values (:nom,:prenom,:pseudo,:email,:mdp);';
|
||||||
|
$this->con->executeQuery($query, array(
|
||||||
|
'nom' => array($nom, PDO::PARAM_STRING),
|
||||||
|
'prenom' => array($prenom, PDO::PARAM_STRING),
|
||||||
|
'pseudo' => array($pseudo, PDO::PARAM_STRING),
|
||||||
|
'email' => array($email, PDO::PARAM_STRING),
|
||||||
|
'mdp' => array($mdp, PDO::PARAM_STRING)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Supprimer(Utilisateur $user){
|
||||||
|
$query='DELETE FROM ToDoList_Utilisateur WHERE id=:id;';
|
||||||
|
$this->con->executeQuery($query, array(
|
||||||
|
'id' => array($user->getNom(), PDO::PARAM_STRING)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
Loading…
Reference in new issue