mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
FIX [personMatcher] wrong syntax was used to setParameter for query in similar person matcher
This commit is contained in:
parent
ef75deda26
commit
73f332927d
@ -79,6 +79,11 @@ class SimilarPersonMatcher
|
||||
->where('SIMILARITY(p.fullnameCanonical, UNACCENT(LOWER(:fullName))) >= :precision')
|
||||
->andWhere($qb->expr()->in('p.center', ':centers'));
|
||||
|
||||
$qb
|
||||
->setParameter('fullName', $this->personRender->renderString($person, []))
|
||||
->setParameter('centers', $centers)
|
||||
->setParameter('precision', $precision);
|
||||
|
||||
if (null !== $person->getBirthdate()) {
|
||||
$qb->andWhere($qb->expr()->orX(
|
||||
$qb->expr()->eq('p.birthdate', ':personBirthdate'),
|
||||
@ -90,13 +95,13 @@ class SimilarPersonMatcher
|
||||
|
||||
if ($person->getId() !== null) {
|
||||
$qb->andWhere($qb->expr()->neq('p.id', ':personId'));
|
||||
$query->setParameter('personId', $person->getId());
|
||||
$qb->setParameter('personId', $person->getId());
|
||||
|
||||
$notDuplicatePersons = $this->personNotDuplicateRepository->findNotDuplicatePerson($person);
|
||||
|
||||
if (count($notDuplicatePersons)) {
|
||||
$qb->andWhere($qb->expr()->notIn('p.id', ':notDuplicatePersons'));
|
||||
$query->setParameter('notDuplicatePersons', $notDuplicatePersons);
|
||||
$qb->setParameter('notDuplicatePersons', $notDuplicatePersons);
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,13 +114,10 @@ class SimilarPersonMatcher
|
||||
case self::SIMILAR_SEARCH_ORDER_BY_SIMILARITY:
|
||||
default:
|
||||
$qb->orderBy('SIMILARITY(p.fullnameCanonical, UNACCENT(LOWER(:fullName)))', 'DESC');
|
||||
$qb->setParameter('fullName', $this->personRender->renderString($person, []));
|
||||
}
|
||||
|
||||
$qb
|
||||
->setParameter('fullName', $this->personRender->renderString($person, []))
|
||||
->setParameter('centers', $centers)
|
||||
->setParameter('precision', $precision);
|
||||
|
||||
dump($qb->getQuery());
|
||||
return $qb->getQuery()->getResult();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user