Add test for AccompanyingCourseController

This commit is contained in:
2021-04-27 22:40:00 +02:00
parent a2160bef7d
commit f7c508939c
3 changed files with 94 additions and 32 deletions

View File

@@ -46,11 +46,13 @@ class AccompanyingPeriodRepository extends ServiceEntityRepository
public function findByPerson(Person $person, $orderBy = null, $limit = null, $offset = null): array
{
$qb = $this->createQueryBuilder('ap');
$qb->join('qb.participations', 'participation')
$qb->join('ap.participations', 'participation')
->where($qb->expr()->eq('participation.person', ':person'))
->orderBy($orderBy)
->setMaxResults($limit)
->setFirstResult($offset)
// ->orderBy($orderBy)
// ->setMaxResults($limit)
//->setFirstResult($offset ?? 0)
->setParameter('person', $person)
;
return $qb->getQuery()->getResult();