public function getRecomendedCommentsCount(JsonSerializationVisitor $visitor, $data, $type) { $commentsCount = $this->commentService->getCommentCounts(array($data->number), true); if (count($commentsCount)) { return $commentsCount[0][1]; } return 0; }