mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-28 01:25:00 +00:00
person: move similar person matcher to PersonACLEwareRepository
This commit is contained in:
@@ -16,8 +16,8 @@ use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\PersonBundle\Form\CreationPersonType;
|
||||
use Chill\PersonBundle\Form\PersonType;
|
||||
use Chill\PersonBundle\Privacy\PrivacyEvent;
|
||||
use Chill\PersonBundle\Repository\PersonACLAwareRepositoryInterface;
|
||||
use Chill\PersonBundle\Repository\PersonRepository;
|
||||
use Chill\PersonBundle\Search\SimilarPersonMatcher;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
@@ -56,11 +56,6 @@ final class PersonController extends AbstractController
|
||||
*/
|
||||
protected $personRepository;
|
||||
|
||||
/**
|
||||
* @var SimilarPersonMatcher
|
||||
*/
|
||||
protected $similarPersonMatcher;
|
||||
|
||||
/**
|
||||
* @var TranslatorInterface
|
||||
*/
|
||||
@@ -81,8 +76,9 @@ final class PersonController extends AbstractController
|
||||
*/
|
||||
private $validator;
|
||||
|
||||
private PersonACLAwareRepositoryInterface $personACLAwareRepository;
|
||||
|
||||
public function __construct(
|
||||
SimilarPersonMatcher $similarPersonMatcher,
|
||||
TranslatorInterface $translator,
|
||||
EventDispatcherInterface $eventDispatcher,
|
||||
PersonRepository $personRepository,
|
||||
@@ -90,9 +86,9 @@ final class PersonController extends AbstractController
|
||||
LoggerInterface $logger,
|
||||
ValidatorInterface $validator,
|
||||
EntityManagerInterface $em,
|
||||
Security $security
|
||||
Security $security,
|
||||
PersonACLAwareRepositoryInterface $personACLAwareRepository
|
||||
) {
|
||||
$this->similarPersonMatcher = $similarPersonMatcher;
|
||||
$this->translator = $translator;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
$this->configPersonAltNameHelper = $configPersonAltNameHelper;
|
||||
@@ -101,6 +97,7 @@ final class PersonController extends AbstractController
|
||||
$this->validator = $validator;
|
||||
$this->em = $em;
|
||||
$this->security = $security;
|
||||
$this->personACLAwareRepository = $personACLAwareRepository;
|
||||
}
|
||||
|
||||
public function editAction($person_id, Request $request)
|
||||
@@ -236,8 +233,8 @@ final class PersonController extends AbstractController
|
||||
$request->getMethod() === Request::METHOD_POST
|
||||
&& $form->isValid()
|
||||
) {
|
||||
$alternatePersons = $this->similarPersonMatcher
|
||||
->matchPerson($person);
|
||||
$alternatePersons = $this->personACLAwareRepository
|
||||
->findMatchingPersons($person);
|
||||
|
||||
if (
|
||||
false === $this->isLastPostDataChanges($form, $request, true)
|
||||
|
Reference in New Issue
Block a user