mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-07-12 20:06:13 +00:00
person search: add birthdate and file number
This commit is contained in:
parent
03fb75edc8
commit
c2cfa19e43
@ -161,7 +161,8 @@ class PersonSearch extends AbstractSearch implements ContainerAwareInterface,
|
|||||||
'p.firstName',
|
'p.firstName',
|
||||||
$qb->expr()->literal(' '),
|
$qb->expr()->literal(' '),
|
||||||
'p.lastName'
|
'p.lastName'
|
||||||
).'AS text'
|
).'AS text',
|
||||||
|
'p.birthdate'
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$qb->select('p');
|
$qb->select('p');
|
||||||
@ -178,7 +179,15 @@ class PersonSearch extends AbstractSearch implements ContainerAwareInterface,
|
|||||||
->addOrderBy('p.lastName');
|
->addOrderBy('p.lastName');
|
||||||
|
|
||||||
if ($options['simplify'] ?? false) {
|
if ($options['simplify'] ?? false) {
|
||||||
return $qb->getQuery()->getResult(Query::HYDRATE_ARRAY);
|
return \array_map(
|
||||||
|
function($row) {
|
||||||
|
$row['text'] .= ' ('.($row['birthdate'] instanceof \DateTimeInterface ? $row['birthdate']->format('d/m/Y').' - ' : '').'dossier n°'.$row['id'].')';
|
||||||
|
|
||||||
|
return $row;
|
||||||
|
}
|
||||||
|
,
|
||||||
|
$qb->getQuery()->getResult(Query::HYDRATE_ARRAY)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return $qb->getQuery()->getResult();
|
return $qb->getQuery()->getResult();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user