Fix entries counter for annotated entries in the menu

The query were badly made and return all annotations for the current user instead of the total of entries with annotation(s).
This commit is contained in:
Jeremy Benoist
2025-02-10 08:42:06 +01:00
parent c7c74de4b8
commit 3dffcadc03
4 changed files with 32 additions and 28 deletions

View File

@ -152,6 +152,12 @@ class AnnotationRepository extends ServiceEntityRepository
->getResult();
}
public function getCountBuilderByUser($userId = null)
{
return $this->createQueryBuilder('e')
->andWhere('e.user = :userId')->setParameter('userId', $userId);
}
/**
* Return a query builder to used by other getBuilderFor* method.
*