mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +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')
|
->where('SIMILARITY(p.fullnameCanonical, UNACCENT(LOWER(:fullName))) >= :precision')
|
||||||
->andWhere($qb->expr()->in('p.center', ':centers'));
|
->andWhere($qb->expr()->in('p.center', ':centers'));
|
||||||
|
|
||||||
|
$qb
|
||||||
|
->setParameter('fullName', $this->personRender->renderString($person, []))
|
||||||
|
->setParameter('centers', $centers)
|
||||||
|
->setParameter('precision', $precision);
|
||||||
|
|
||||||
if (null !== $person->getBirthdate()) {
|
if (null !== $person->getBirthdate()) {
|
||||||
$qb->andWhere($qb->expr()->orX(
|
$qb->andWhere($qb->expr()->orX(
|
||||||
$qb->expr()->eq('p.birthdate', ':personBirthdate'),
|
$qb->expr()->eq('p.birthdate', ':personBirthdate'),
|
||||||
@ -90,13 +95,13 @@ class SimilarPersonMatcher
|
|||||||
|
|
||||||
if ($person->getId() !== null) {
|
if ($person->getId() !== null) {
|
||||||
$qb->andWhere($qb->expr()->neq('p.id', ':personId'));
|
$qb->andWhere($qb->expr()->neq('p.id', ':personId'));
|
||||||
$query->setParameter('personId', $person->getId());
|
$qb->setParameter('personId', $person->getId());
|
||||||
|
|
||||||
$notDuplicatePersons = $this->personNotDuplicateRepository->findNotDuplicatePerson($person);
|
$notDuplicatePersons = $this->personNotDuplicateRepository->findNotDuplicatePerson($person);
|
||||||
|
|
||||||
if (count($notDuplicatePersons)) {
|
if (count($notDuplicatePersons)) {
|
||||||
$qb->andWhere($qb->expr()->notIn('p.id', ':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:
|
case self::SIMILAR_SEARCH_ORDER_BY_SIMILARITY:
|
||||||
default:
|
default:
|
||||||
$qb->orderBy('SIMILARITY(p.fullnameCanonical, UNACCENT(LOWER(:fullName)))', 'DESC');
|
$qb->orderBy('SIMILARITY(p.fullnameCanonical, UNACCENT(LOWER(:fullName)))', 'DESC');
|
||||||
|
$qb->setParameter('fullName', $this->personRender->renderString($person, []));
|
||||||
}
|
}
|
||||||
|
|
||||||
$qb
|
dump($qb->getQuery());
|
||||||
->setParameter('fullName', $this->personRender->renderString($person, []))
|
|
||||||
->setParameter('centers', $centers)
|
|
||||||
->setParameter('precision', $precision);
|
|
||||||
|
|
||||||
return $qb->getQuery()->getResult();
|
return $qb->getQuery()->getResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user