|
|
@ -36,6 +36,7 @@ class UserGateway
|
|
|
|
|
|
|
|
|
|
|
|
public function findByName(string $username): ?User{
|
|
|
|
public function findByName(string $username): ?User{
|
|
|
|
$usr=null;
|
|
|
|
$usr=null;
|
|
|
|
|
|
|
|
|
|
|
|
$query = "SELECT * FROM Utilisateur WHERE username=:username";
|
|
|
|
$query = "SELECT * FROM Utilisateur WHERE username=:username";
|
|
|
|
$this->con->executeQuery($query, array(':username' => array($username, PDO::PARAM_STR)));
|
|
|
|
$this->con->executeQuery($query, array(':username' => array($username, PDO::PARAM_STR)));
|
|
|
|
$results=$this->con->getResults();
|
|
|
|
$results=$this->con->getResults();
|
|
|
@ -43,6 +44,7 @@ class UserGateway
|
|
|
|
$usr = new User($user['id'], $user['username'], $user['password']);
|
|
|
|
$usr = new User($user['id'], $user['username'], $user['password']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $usr;
|
|
|
|
return $usr;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function getLastId(): array{
|
|
|
|
public function getLastId(): array{
|
|
|
|