public function getTheOccurrenceOfTheTopic($topicId) { $query = $this->createQueryBuilder('t')->select('count(t)')->where('t.topic = :topicId')->setParameter('topicId', $topicId)->getQuery(); return $query; }