incrArticleReportCount($item); } elseif ($item instanceof QuestionModel) { $this->incrQuestionReportCount($item); } elseif ($item instanceof AnswerModel) { $this->incrAnswerReportCount($item); } elseif ($item instanceof CommentModel) { $this->incrCommentReportCount($item); } } protected function incrArticleReportCount(ArticleModel $article) { $article->report_count += 1; $article->update(); } protected function incrQuestionReportCount(QuestionModel $question) { $question->report_count += 1; $question->update(); } protected function incrAnswerReportCount(AnswerModel $answer) { $answer->report_count += 1; $answer->update(); } protected function incrCommentReportCount(CommentModel $comment) { $comment->report_count += 1; $comment->update(); } }