Beispiel #1
0
 public function saveBlogContent(Blogcontent $contenu)
 {
     $id = (int) $contenu->getId();
     if ($id > 0) {
         $requete = $this->dbGateway->prepare("\r\n\t\t\t\tUPDATE contenu \r\n\t\t\t\tSET titre= :titre, \r\n\t\t\t\tsoustitre = :soustitre,\r\n\t\t\t\tsousrubriques_id = :sousrubriques_id,\r\n\t\t\t\tcontenuhtml = :contenuhtml,\r\n                                rang = :rang,\r\n                                image = :image,\r\n                                image2 = :image2,\r\n                                author = :author,\r\n                                themes = :themes,\r\n                                contenu_date = :blogdate,\r\n                                othertext1 = :text1,\r\n                                othertext2 = :text2,\r\n                                othertext3 = :text3\r\n\t\t\t\tWHERE contenu_id = :id\r\n\t\t\t") or die(print_r($this->dbGateway->errors_info()));
         $requete->execute(array('id' => $id, 'titre' => $contenu->getTitre(), 'soustitre' => $contenu->getSousTitre(), 'rang' => $contenu->getRang(), 'image' => $contenu->getImage(), 'image2' => $contenu->getImage2(), 'sousrubriques_id' => $contenu->getSousRubrique()->getId(), 'contenuhtml' => $contenu->getContenuHtml(), 'author' => $contenu->getAuthor(), 'themes' => $contenu->getThemes(), 'blogdate' => $contenu->getDate(), 'text1' => $contenu->getText1(), 'text2' => $contenu->getText2(), 'text3' => $contenu->getText3()));
     } else {
         $requete = $this->dbGateway->prepare("INSERT into contenu(titre,soustitre,sousrubriques_id,contenuhtml, rang, image, image2, type, author, themes, contenu_date, othertext1, othertext2, othertext3) \r\n\t\t\t\t\tvalues(:titre, :soustitre,:sousrubriques_id,:contenuhtml, :rang, :image, :image2, :type, :author, :themes, :blogdate, :text1, :text2, :text3)") or die(print_r($this->dbGateway->error_info()));
         $requete->execute(array('titre' => $contenu->getTitre(), 'soustitre' => $contenu->getSousTitre(), 'sousrubriques_id' => $contenu->getSousRubrique()->getId(), 'contenuhtml' => $contenu->getContenuHtml(), 'rang' => $contenu->getRang(), 'image' => $contenu->getImage(), 'image2' => $contenu->getImage2(), 'type' => $contenu->getType(), 'author' => $contenu->getAuthor(), 'themes' => $contenu->getThemes(), 'blogdate' => $contenu->getDate(), 'text1' => $contenu->getText1(), 'text2' => $contenu->getText2(), 'text3' => $contenu->getText3()));
     }
 }