feat: add AwardTypeRepository::findWithMinActors()
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user