checkComment($id); $chapter = $this->checkChapter($comment->chapter_id); $course = $this->checkCourse($comment->course_id); $user = $this->getLoginUser(); $validator = new CommentValidator(); $validator->checkOwner($user->id, $comment->user_id); $comment->delete(); $this->decrChapterCommentCount($chapter); $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); } }