- $query->useQueryCache(true);
- $query->useResultCache(true);
- $query->setResultCacheLifetime($this->lifeTime);
+ $qb = $this->createQueryBuilder('e')
+ ->select('count(e.id)')
+ ->leftJoin('e.tags', 't')
+ ->where('e.user=:userId')->setParameter('userId', $userId)
+ ->andWhere('t.id=:tagId')->setParameter('tagId', $tagId)
+ ;