feat: add AwardTypeRepository::findWithMinActors()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
thibaud-leclere
2026-04-01 22:58:52 +02:00
parent 5fbac8359f
commit 67571e8b33
4 changed files with 87 additions and 0 deletions

View File

@@ -21,4 +21,17 @@ class AwardTypeRepository extends ServiceEntityRepository
{
return parent::findAll();
}
/** @return list<AwardType> */
public function findWithMinActors(int $minActors): array
{
return $this->createQueryBuilder('at')
->join('at.awards', 'a')
->groupBy('at.id')
->having('COUNT(DISTINCT a.actor) >= :minActors')
->setParameter('minActors', $minActors)
->orderBy('at.name', 'ASC')
->getQuery()
->getResult();
}
}