checkComment($id); $user = $this->getLoginUser(); $validator = new CommentValidator(); $validator->checkOwner($user->id, $comment->owner_id); $comment->deleted = 1; $comment->update(); if ($comment->parent_id > 0) { $parent = $this->checkComment($comment->parent_id); $this->decrCommentReplyCount($parent); } if ($comment->item_type == CommentModel::ITEM_CHAPTER) { $chapter = $this->checkChapter($comment->item_id); $this->decrChapterCommentCount($chapter); } elseif ($comment->item_type == CommentModel::ITEM_ARTICLE) { $article = $this->checkArticle($comment->item_id); $this->decrArticleCommentCount($article); } } }