createQueryBuilder('s'); return $qb ->select('COUNT(s)') ->innerJoin('s.author', 'a') ->where('a.id = :id') ->setParameter('id', $id) ->getQuery()->getSingleScalarResult() ; } }