public function isFollowed($topicId) { $topic = $this->em->getRepository('Newscoop\\Entity\\UserTopic')->getTheOccurrenceOfTheUserTopic($topicId)->getSingleScalarResult(); $count = (int) $topic; if ($count > 0) { return true; } return false; }