mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
WIP: first implementation for test
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
namespace Chill\PersonBundle\Repository;
|
||||
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
@@ -39,4 +40,20 @@ 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('qb.participations', 'participation')
|
||||
->where($qb->expr()->eq('participation.person', ':person'))
|
||||
->orderBy($orderBy)
|
||||
->setMaxResults($limit)
|
||||
->setFirstResult($offset)
|
||||
;
|
||||
|
||||
return $qb->getQuery()->getResult();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user