private function validate() { if ($this->submit) { //Categorie always "nom" TODO… try { $forbidden = array(); for ($i = 1; isset($this->res['tabou' . $i]); $i++) { array_push($forbidden, $this->res['tabou' . $i]); } $carte = new Card($this->userlang, NULL, $this->res['nivcarte'], "nom", $this->createur, $this->res['mot'], $forbidden, array($this->res['theme_carte']), './views/card.inline.display.php'); $carte->store(); $_SESSION["LastStoredId"] = $carte->get_id(); $this->card = $carte; $this->res = array('carteID' => $_SESSION["LastStoredId"]); } catch (Exception $e) { echo $e; return false; } return true; } else { return false; } }