Example #1
0
 /**
  * Обновляет топик
  *
  * @param ModuleTopic_EntityTopic $oTopic    Объект топика
  *
  * @return bool
  */
 public function UpdateTopic(ModuleTopic_EntityTopic $oTopic)
 {
     $sql = "UPDATE ?_topic\n\t\t\tSET \n\t\t\t\tblog_id = ?d,\n\t\t\t\ttopic_title = ?,\n\t\t\t\ttopic_tags = ?,\n\t\t\t\ttopic_date_add = ?,\n\t\t\t\ttopic_date_edit = ?,\n\t\t\t\ttopic_date_show = ?,\n\t\t\t\ttopic_user_ip = ?,\n\t\t\t\ttopic_publish = ?d ,\n\t\t\t\ttopic_publish_draft = ?d ,\n\t\t\t\ttopic_publish_index = ?d,\n\t\t\t\ttopic_rating = ?f,\n\t\t\t\ttopic_count_vote = ?d,\n\t\t\t\ttopic_count_vote_up = ?d,\n\t\t\t\ttopic_count_vote_down = ?d,\n\t\t\t\ttopic_count_vote_abstain = ?d,\n\t\t\t\ttopic_count_read = ?d,\n\t\t\t\ttopic_count_comment = ?d,\n\t\t\t\ttopic_count_favourite = ?d,\n\t\t\t\ttopic_cut_text = ? ,\n\t\t\t\ttopic_forbid_comment = ? ,\n\t\t\t\ttopic_text_hash = ?,\n\t\t\t\ttopic_url = ?,\n\t\t\t\ttopic_index_ignore = ?d\n\t\t\tWHERE\n\t\t\t\ttopic_id = ?d\n\t\t";
     $bResult = $this->oDb->query($sql, $oTopic->getBlogId(), $oTopic->getTitle(), $oTopic->getTags(), $oTopic->getDateAdd(), $oTopic->getDateEdit(), $oTopic->getDateShow(), $oTopic->getUserIp(), $oTopic->getPublish() ? 1 : 0, $oTopic->getPublishDraft() ? 1 : 0, $oTopic->getPublishIndex() ? 1 : 0, $oTopic->getRating(), $oTopic->getCountVote(), $oTopic->getCountVoteUp(), $oTopic->getCountVoteDown(), $oTopic->getCountVoteAbstain(), $oTopic->getCountRead(), $oTopic->getCountComment(), $oTopic->getCountFavourite(), $oTopic->getCutText(), $oTopic->getForbidComment(), $oTopic->getTextHash(), $oTopic->getTopicUrl(), $oTopic->getTopicIndexIgnore(), $oTopic->getId());
     if ($bResult !== false) {
         $this->UpdateTopicContent($oTopic);
         return true;
     }
     return false;
 }