forked from tom.biard/ScienceQuest
parent
f2e574fec2
commit
9f95b0e771
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace model;
|
||||
|
||||
class MdlInvite extends MdlBase{
|
||||
private InviteGateway $gw;
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->gw = new InviteGateway($this->con);
|
||||
}
|
||||
|
||||
public function setPseudo(int $id, string $pseudo): Invite{
|
||||
$this->gw->setPseudo($id, $pseudo);
|
||||
return $this->getFromId($id);
|
||||
}
|
||||
|
||||
public function insertInvite(string $pseudo, string $idSession): Invite{
|
||||
$id = $this->gw->insertInvite($pseudo, $idSession);
|
||||
return $this->getFromId($id);
|
||||
}
|
||||
|
||||
public function getFromId(int $id): Invite{
|
||||
$row = $this->gw->getFromId($id);
|
||||
return new Invite($row['idjoueur'], $row['pseudo'], $row['idsession']);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue