public function getCommentCount(TutorialInterface $tutorial) { $threadRepo = $this->em->getRepository('ProtonCommentBundle:Thread'); $thread = $threadRepo->findOneBy(array('id' => $tutorial->getSlug())); return $thread->getNumComments(); }