mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge branch 'bootstrap-serializer' into fix-tests-main
This commit is contained in:
commit
86d13410c3
@ -39,23 +39,4 @@ class AccompanyingPeriodRepository extends ServiceEntityRepository
|
|||||||
{
|
{
|
||||||
parent::__construct($registry, AccompanyingPeriod::class);
|
parent::__construct($registry, AccompanyingPeriod::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array|AccompanyingPeriod[]
|
|
||||||
*/
|
|
||||||
public function findByPerson(Person $person, $orderBy = null, $limit = null, $offset = null): array
|
|
||||||
{
|
|
||||||
$qb = $this->createQueryBuilder('ap');
|
|
||||||
$qb->join('ap.participations', 'participation')
|
|
||||||
->where($qb->expr()->eq('participation.person', ':person'))
|
|
||||||
|
|
||||||
// ->orderBy($orderBy)
|
|
||||||
// ->setMaxResults($limit)
|
|
||||||
//->setFirstResult($offset ?? 0)
|
|
||||||
->setParameter('person', $person)
|
|
||||||
;
|
|
||||||
|
|
||||||
return $qb->getQuery()->getResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -164,8 +164,7 @@ class AccompanyingCourseControllerTest extends WebTestCase
|
|||||||
|
|
||||||
$person = $em->getRepository(Person::class)
|
$person = $em->getRepository(Person::class)
|
||||||
->find($id);
|
->find($id);
|
||||||
$periods = $em->getRepository(AccompanyingPeriod::class)
|
$periods = $person->getAccompanyingPeriods();
|
||||||
->findByPerson($person);
|
|
||||||
|
|
||||||
yield [\array_pop($personIds)["id"], $periods[\array_rand($periods)] ];
|
yield [\array_pop($personIds)["id"], $periods[\array_rand($periods)] ];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user