mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Use repositories as services.
This commit is contained in:
@@ -38,6 +38,7 @@ use Symfony\Component\Translation\TranslatorInterface;
|
||||
use Chill\MainBundle\Search\SearchProvider;
|
||||
use Chill\PersonBundle\Repository\PersonRepository;
|
||||
use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper;
|
||||
use Chill\PersonBundle\Repository\PersonNotDuplicateRepository;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
@@ -290,7 +291,7 @@ final class PersonController extends AbstractController
|
||||
return $errors;
|
||||
}
|
||||
|
||||
public function reviewAction(Request $request)
|
||||
public function reviewAction(Request $request, PersonNotDuplicateRepository $personNotDuplicateRepository)
|
||||
{
|
||||
if ($request->getMethod() !== 'POST') {
|
||||
$r = new Response("You must send something to review the creation of a new Person");
|
||||
@@ -342,8 +343,7 @@ final class PersonController extends AbstractController
|
||||
|
||||
$this->em->persist($person);
|
||||
|
||||
$alternatePersons = $this->similarPersonMatcher
|
||||
->matchPerson($person);
|
||||
$alternatePersons = $this->similarPersonMatcher->matchPerson($person, $personNotDuplicateRepository);
|
||||
|
||||
if (count($alternatePersons) === 0) {
|
||||
return $this->forward('ChillPersonBundle:Person:create');
|
||||
|
Reference in New Issue
Block a user