mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Use repositories as services.
This commit is contained in:
@@ -62,7 +62,7 @@ class SimilarPersonMatcher
|
||||
$this->tokenStorage = $tokenStorage;
|
||||
}
|
||||
|
||||
public function matchPerson(Person $person, $precision = 0.15, $orderBy = self::SIMILAR_SEARCH_ORDER_BY_SIMILARITY)
|
||||
public function matchPerson(Person $person, PersonNotDuplicateRepository $personNotDuplicateRepository, $precision = 0.15, $orderBy = self::SIMILAR_SEARCH_ORDER_BY_SIMILARITY)
|
||||
{
|
||||
$centers = $this->authorizationHelper->getReachableCenters(
|
||||
$this->tokenStorage->getToken()->getUser(),
|
||||
@@ -77,8 +77,7 @@ class SimilarPersonMatcher
|
||||
. ' AND p.id != :personId '
|
||||
;
|
||||
|
||||
$notDuplicatePersons = $this->em->getRepository(PersonNotDuplicate::class)
|
||||
->findNotDuplicatePerson($person);
|
||||
$notDuplicatePersons = $personNotDuplicateRepository->findNotDuplicatePerson($person);
|
||||
|
||||
if (count($notDuplicatePersons)) {
|
||||
$dql .= ' AND p.id not in (:notDuplicatePersons)';
|
||||
|
Reference in New Issue
Block a user