owner_id != $item->owner_id) { $this->handleArticleCommentedNotice($item, $comment); } } elseif ($item instanceof QuestionModel) { if ($comment->owner_id != $item->owner_id) { $this->handleQuestionCommentedNotice($item, $comment); } } elseif ($item instanceof AnswerModel) { if ($comment->owner_id != $item->owner_id) { $this->handleAnswerCommentedNotice($item, $comment); } } } protected function handleArticleCommentedNotice(ArticleModel $article, CommentModel $comment) { $notice = new ArticleCommentedNotice(); $notice->handle($article, $comment); } protected function handleQuestionCommentedNotice(QuestionModel $question, CommentModel $comment) { $notice = new QuestionCommentedNotice(); $notice->handle($question, $comment); } protected function handleAnswerCommentedNotice(AnswerModel $answer, CommentModel $comment) { $notice = new AnswerCommentedNotice(); $notice->handle($answer, $comment); } protected function handleCommentRepliedNotice(CommentModel $reply) { $notice = new CommentRepliedNotice(); $notice->handle($reply); } protected function handleCommentPostPoint(CommentModel $comment) { if ($comment->published != CommentModel::PUBLISH_APPROVED) return; $service = new CommentPostPointHistory(); $service->handle($comment); } }