public function add(Commentaire $commentaire) { $q = $this->_db->prepare('INSERT INTO commentaire SET voiture = :voiture, technicien = :technicien, date = :datecommentaire, texte= :texte'); $q->bindValue(':voiture', $commentaire->voiture(), PDO::PARAM_STR); $q->bindValue(':technicien', $commentaire->technicien(), PDO::PARAM_INT); $q->bindValue(':datecommentaire', $commentaire->datecommentaire(), PDO::PARAM_STR); // insère la date au format Y-m-d H:i:s $q->bindValue(':texte', $commentaire->texte(), PDO::PARAM_STR); $q->execute(); return self::ACTION_REUSSIE; }