public function AddComment(ModuleComment_EntityComment $oComment)
 {
     $sql = "INSERT INTO " . Config::Get('db.table.comment') . " \n\t\t\t(comment_pid,\n\t\t\ttarget_id,\n\t\t\ttarget_type,\n\t\t\ttarget_parent_id,\n\t\t\tuser_id,\n\t\t\tcomment_text,\n\t\t\tcomment_date,\n\t\t\tcomment_user_ip,\n\t\t\tcomment_text_hash,\n            guest_name,\n            guest_email\t\t\n\t\t\t)\n\t\t\tVALUES(?, ?d, ?, ?d, ?d, ?, ?, ?, ?, ?, ?)\n\t\t";
     if ($iId = $this->oDb->query($sql, $oComment->getPid(), $oComment->getTargetId(), $oComment->getTargetType(), $oComment->getTargetParentId(), $oComment->getUserId(), $oComment->getText(), $oComment->getDate(), $oComment->getUserIp(), $oComment->getTextHash(), $oComment->getGuestName(), $oComment->getGuestEmail())) {
         return $iId;
     }
     return false;
 }
 /**
  * Обновляет коммент
  *
  * @param  ModuleComment_EntityComment $oComment Объект комментария
  * @return bool
  */
 public function UpdateComment(ModuleComment_EntityComment $oComment)
 {
     $sql = "UPDATE " . Config::Get('db.table.comment') . "\n\t\t\tSET \n\t\t\t\tcomment_text= ?,\n\t\t\t\tcomment_text_source= ?,\n\t\t\t\tcomment_rating= ?f,\n\t\t\t\tcomment_count_vote= ?d,\n\t\t\t\tcomment_count_favourite= ?d,\n\t\t\t\tcomment_count_edit= ?d,\n\t\t\t\tcomment_date_edit= ?,\n\t\t\t\tcomment_delete = ?d ,\n\t\t\t\tcomment_publish = ?d ,\n\t\t\t\tcomment_text_hash = ?\n\t\t\tWHERE\n\t\t\t\tcomment_id = ?d\n\t\t";
     $res = $this->oDb->query($sql, $oComment->getText(), $oComment->getTextSource(), $oComment->getRating(), $oComment->getCountVote(), $oComment->getCountFavourite(), $oComment->getCountEdit(), $oComment->getDateEdit(), $oComment->getDelete(), $oComment->getPublish(), $oComment->getTextHash(), $oComment->getId());
     return $this->IsSuccessful($res);
 }
Esempio n. 3
0
 public function UpdateComment(ModuleComment_EntityComment $oComment)
 {
     $sql = "UPDATE " . Config::Get('db.table.comment') . " \n\t\t\tSET \n\t\t\t\tcomment_text= ?,\n\t\t\t\tcomment_rating= ?f,\n\t\t\t\tcomment_count_vote= ?d,\n\t\t\t\tcomment_delete = ?d ,\n\t\t\t\tcomment_publish = ?d ,\n\t\t\t\tcomment_text_hash = ?\n\t\t\tWHERE\n\t\t\t\tcomment_id = ?d\n\t\t";
     if ($this->oDb->query($sql, $oComment->getText(), $oComment->getRating(), $oComment->getCountVote(), $oComment->getDelete(), $oComment->getPublish(), $oComment->getTextHash(), $oComment->getId())) {
         return true;
     }
     return false;
 }
Esempio n. 4
0
 /**
  * Обновляет коммент
  *
  * @param  ModuleComment_EntityComment $oComment    Объект комментария
  *
  * @return bool
  */
 public function UpdateComment(ModuleComment_EntityComment $oComment)
 {
     $sql = "UPDATE ?_comment\n\t\t\tSET \n\t\t\t\tcomment_text= ?,\n\t\t\t\tcomment_rating= ?f,\n\t\t\t\tcomment_count_vote= ?d,\n\t\t\t\tcomment_count_favourite= ?d,\n\t\t\t\tcomment_delete = ?d ,\n\t\t\t\tcomment_publish = ?d ,\n\t\t\t\tcomment_date_edit = CASE comment_text_hash WHEN ? THEN comment_date_edit ELSE ? END,\n\t\t\t\tcomment_text_hash = ?\n\t\t\tWHERE\n\t\t\t\tcomment_id = ?d\n\t\t";
     $bResult = $this->oDb->query($sql, $oComment->getText(), $oComment->getRating(), $oComment->getCountVote(), $oComment->getCountFavourite(), $oComment->getDelete(), $oComment->getPublish(), $oComment->getTextHash(), F::Now(), $oComment->getTextHash(), $oComment->getId());
     return $bResult !== false;
 }