diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php index 937bfcd8d..fffb55ede 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php @@ -39,23 +39,4 @@ class AccompanyingPeriodRepository extends ServiceEntityRepository { 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(); - } - } diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php index 5b21fa451..c45cb93d9 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php @@ -164,8 +164,7 @@ class AccompanyingCourseControllerTest extends WebTestCase $person = $em->getRepository(Person::class) ->find($id); - $periods = $em->getRepository(AccompanyingPeriod::class) - ->findByPerson($person); + $periods = $person->getAccompanyingPeriods(); yield [\array_pop($personIds)["id"], $periods[\array_rand($periods)] ];