Esempio n. 1
0
 protected function add(Comment $comment)
 {
     $q = $this->dao->prepare('INSERT INTO t_for_commentc SET FCC_fk_FNC = :newsId, FCC_fk_FMC = :auteurId, FCC_content = :contenu, FCC_dateadd = NOW(), FCC_dateupdate = NOW()');
     $q->bindValue(':newsId', $comment->newsId(), \PDO::PARAM_INT);
     $q->bindValue(':auteurId', $comment->auteurId(), \PDO::PARAM_INT);
     $q->bindValue(':contenu', $comment->contenu(), \PDO::PARAM_STR);
     $q->execute();
     $comment->setId($this->dao->lastInsertId());
 }