checkComment($id); $user = $this->getLoginUser(); $validator = new CommentValidator(); $validator->checkOwner($user->id, $comment->user_id); $comment->deleted = 1; $comment->update(); $chapter = $this->checkChapterCache($comment->chapter_id); $this->decrChapterCommentCount($chapter); $course = $this->checkCourseCache($comment->course_id); $this->decrCourseCommentCount($course); } protected function decrChapterCommentCount(ChapterModel $chapter) { $this->eventsManager->fire('chapterCounter:decrCommentCount', $this, $chapter); } protected function decrCourseCommentCount(CourseModel $course) { $this->eventsManager->fire('courseCounter:decrCommentCount', $this, $course); } }