|
|
|
@ -13,17 +13,25 @@ class EvenementGateway
|
|
|
|
|
$this->con = $con;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getNewId()
|
|
|
|
|
{
|
|
|
|
|
$query='SELECT MAX(id) FROM Evenement';
|
|
|
|
|
$this->con->executeQuery($query);
|
|
|
|
|
$res=$this->con->getResults();
|
|
|
|
|
return $res[0]['MAX(id)']+1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function insertEvenement(Evenement $evenement)
|
|
|
|
|
{
|
|
|
|
|
$query='INSERT INTO Evenement VALUES (:i, :o, :t, :d, :date, :nb, :img)';
|
|
|
|
|
$this->con->executeQuery($query, array(
|
|
|
|
|
':i' => array($evenement->getId(), \PDO::PARAM_INT),
|
|
|
|
|
':o' => array($evenement->getOrganisateur(), \PDO::PARAM_STR),
|
|
|
|
|
':o' => array($evenement->getOrganisateurId(), \PDO::PARAM_INT),
|
|
|
|
|
':t' => array($evenement->getTitre(), \PDO::PARAM_STR),
|
|
|
|
|
':d' => array($evenement->getDescription(), \PDO::PARAM_STR),
|
|
|
|
|
':date' => array($evenement->getDate(), \PDO::PARAM_STR),
|
|
|
|
|
':nb' => array($evenement->getNbPlaceMax(), \PDO::PARAM_INT),
|
|
|
|
|
':img' => array($evenement->getImage(), \PDO::PARAM_INT)
|
|
|
|
|
':img' => array($evenement->getImageId(), \PDO::PARAM_INT)
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|