mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
residential address: filter by person in the repository
This commit is contained in:
parent
a7240e8cc6
commit
48a32f2403
@ -50,6 +50,8 @@ class ResidentialAddressRepository extends ServiceEntityRepository
|
||||
$date = null === $at ? new DateTimeImmutable('today') : $at;
|
||||
$qb = $this->createQueryBuilder('ra');
|
||||
|
||||
|
||||
|
||||
$dateFilter = $qb->expr()->andX(
|
||||
$qb->expr()->lte('ra.startDate', ':dateIn'),
|
||||
$qb->expr()->orX(
|
||||
@ -60,7 +62,9 @@ class ResidentialAddressRepository extends ServiceEntityRepository
|
||||
|
||||
$qb
|
||||
->where($dateFilter)
|
||||
->setParameter('dateIn', $date, Types::DATE_IMMUTABLE);
|
||||
->setParameter('dateIn', $date, Types::DATE_IMMUTABLE)
|
||||
->andWhere('ra.person = :person')
|
||||
->setParameter('person', $person);
|
||||
|
||||
return $qb;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user