id = $id; $this->username = $pseudo; $this->passwd = $password; $this->hidenPasswd = hidenPassWd($password); $this->img = $image; $this->email = $mail; } public function updateUsername(string $newUsername){ if(isset($newUsername)){ $this->username = $newUsername; } } public function updateEmail(string $newEmail) { if(isset($newEmail)){ $this->email = $newEmail; } } public function modifyImage(string $image){ if(isset($image)){ $u->img = $image; } } } include("Connection.php"); $dsn = "pgsql:host=londres;dbname="; $username = ""; $password = ""; $con = new Connection($dsn,$username,$password); $query = 'SELECT * FROM Users WHERE id_user=:idUser'; $con->executeQuery($query, array(':idUser'=>array('U001', PDO::PARAM_STR))); $result = $con->getResults(); $u = new User($result[0]['id_user'],$result[0]['username'], $result[0]['pssword'], '../../images/imageProfil.png', $result[0]['email']); /*Test*/ function hidenPassWd(string $passwd){ if(strlen($passwd) >= 16) return str_repeat('*', 16); return str_repeat('*', strlen($passwd)); } ?>