|
|
@ -17,19 +17,19 @@ class MdlUser extends MdlBase{
|
|
|
|
$temp->insertJoueur($username);
|
|
|
|
$temp->insertJoueur($username);
|
|
|
|
return $this->gw->register($username, $password, $temp->getFromPseudo($username)["id"]);
|
|
|
|
return $this->gw->register($username, $password, $temp->getFromPseudo($username)["id"]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
|
|
|
|
public function setPseudo(int $id, string $pseudo): User{
|
|
|
|
public function setPseudo(int $id, string $pseudo): Utilisateur{
|
|
|
|
$this->gw->setPseudo($id, $pseudo);
|
|
|
|
$this->gw->setPseudo($id, $pseudo);
|
|
|
|
return $this->getFromId($id);
|
|
|
|
return $this->getFromId($id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function insertInvite(string $pseudo, string $idSession): User{
|
|
|
|
public function getFromId(int $id): Utilisateur{
|
|
|
|
$id = $this->gw->insertInvite($pseudo, $idSession);
|
|
|
|
$row = $this->gw->getFromId($id);
|
|
|
|
return $this->getFromId($id);
|
|
|
|
return new Utilisateur($row['idjoueur'], $row['pseudo'], $row['email'], $row['password']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function getFromId(int $id): User{
|
|
|
|
public function getFromPseudo(string $pseudo): Utilisateur{
|
|
|
|
$row = $this->gw->getFromId($id);
|
|
|
|
$row = $this->gw->getFromPseudo($pseudo);
|
|
|
|
return new Invite($row['idjoueur'], $row['pseudo'], $row['idsession']);
|
|
|
|
return new Utilisateur($row['idjoueur'], $row['pseudo'], $row['email'], $row['password']);
|
|
|
|
}*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|