mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +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;
|
$date = null === $at ? new DateTimeImmutable('today') : $at;
|
||||||
$qb = $this->createQueryBuilder('ra');
|
$qb = $this->createQueryBuilder('ra');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$dateFilter = $qb->expr()->andX(
|
$dateFilter = $qb->expr()->andX(
|
||||||
$qb->expr()->lte('ra.startDate', ':dateIn'),
|
$qb->expr()->lte('ra.startDate', ':dateIn'),
|
||||||
$qb->expr()->orX(
|
$qb->expr()->orX(
|
||||||
@ -60,7 +62,9 @@ class ResidentialAddressRepository extends ServiceEntityRepository
|
|||||||
|
|
||||||
$qb
|
$qb
|
||||||
->where($dateFilter)
|
->where($dateFilter)
|
||||||
->setParameter('dateIn', $date, Types::DATE_IMMUTABLE);
|
->setParameter('dateIn', $date, Types::DATE_IMMUTABLE)
|
||||||
|
->andWhere('ra.person = :person')
|
||||||
|
->setParameter('person', $person);
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user