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;
 }
Esempio n. 2
0
 /**
  * Добавляет коммент
  *
  * @param  ModuleComment_EntityComment $oComment    Объект комментария
  *
  * @return bool|int
  */
 public function AddComment(ModuleComment_EntityComment $oComment)
 {
     $sql = "INSERT INTO ?_comment\n          (\n              comment_pid,\n              target_id,\n              target_type,\n              target_parent_id,\n              user_id,\n              comment_text,\n              comment_date,\n              comment_user_ip,\n              comment_publish,\n              comment_text_hash\n          )\n          VALUES (\n              ?, ?d, ?, ?d, ?d, ?, ?, ?, ?d, ?\n          )\n        ";
     $iId = $this->oDb->query($sql, $oComment->getPid(), $oComment->getTargetId(), $oComment->getTargetType(), $oComment->getTargetParentId(), $oComment->getUserId(), $oComment->getText(), $oComment->getDate(), $oComment->getUserIp(), $oComment->getPublish(), $oComment->getTextHash());
     return $iId ? $iId : false;
 }
 /**
  * Добавляет коммент
  *
  * @param  ModuleComment_EntityComment $oComment Объект комментария
  * @return bool|int
  */
 public function AddComment(ModuleComment_EntityComment $oComment)
 {
     $sql = "INSERT INTO " . Config::Get('db.table.comment') . "\n      (comment_pid,\n      target_id,\n      target_type,\n      target_parent_id,\n      user_id,\n      comment_text,\n      comment_date,\n      comment_user_ip,\n      comment_publish,\n      comment_text_hash\n      )\n      VALUES(?, ?d, ?, ?d, ?d, ?, ?, ?, ?d, ?)\n    ";
     if ($iId = $this->oDb->query($sql, $oComment->getPid(), $oComment->getTargetId(), $oComment->getTargetType(), $oComment->getTargetParentId(), $oComment->getUserId(), $oComment->getText(), $oComment->getDate(), $oComment->getUserIp(), $oComment->getPublish(), $oComment->getTextHash())) {
         return $iId;
     }
     return false;
 }