mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
ChillPersonBundle: persist new Persons
This commit is contained in:
parent
f02d6df262
commit
b43f43fa0b
@ -39,6 +39,7 @@ use Chill\MainBundle\Search\SearchProvider;
|
||||
use Chill\PersonBundle\Repository\PersonRepository;
|
||||
use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
/**
|
||||
* Class PersonController
|
||||
@ -76,6 +77,12 @@ class PersonController extends AbstractController
|
||||
*/
|
||||
protected $configPersonAltNameHelper;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var EntityManagerInterface
|
||||
*/
|
||||
protected $em;
|
||||
|
||||
/**
|
||||
* @var \Psr\Log\LoggerInterface
|
||||
*/
|
||||
@ -93,7 +100,8 @@ class PersonController extends AbstractController
|
||||
PersonRepository $personRepository,
|
||||
ConfigPersonAltNamesHelper $configPersonAltNameHelper,
|
||||
LoggerInterface $logger,
|
||||
ValidatorInterface $validator
|
||||
ValidatorInterface $validator,
|
||||
EntityManagerInterface $em
|
||||
) {
|
||||
$this->similarPersonMatcher = $similarPersonMatcher;
|
||||
$this->translator = $translator;
|
||||
@ -102,6 +110,7 @@ class PersonController extends AbstractController
|
||||
$this->personRepository = $personRepository;
|
||||
$this->logger = $logger;
|
||||
$this->validator = $validator;
|
||||
$this->em = $em;
|
||||
}
|
||||
|
||||
public function getCFGroup()
|
||||
@ -343,6 +352,8 @@ class PersonController extends AbstractController
|
||||
$this->logger->info('Person created without errors');
|
||||
}
|
||||
|
||||
$this->em->persist($person);
|
||||
|
||||
$alternatePersons = $this->similarPersonMatcher
|
||||
->matchPerson($person);
|
||||
|
||||
|
@ -8,6 +8,7 @@ services:
|
||||
$configPersonAltNameHelper: '@Chill\PersonBundle\Config\ConfigPersonAltNamesHelper'
|
||||
$logger: '@Psr\Log\LoggerInterface'
|
||||
$validator: '@Symfony\Component\Validator\Validator\ValidatorInterface'
|
||||
$em: '@Doctrine\ORM\EntityManagerInterface'
|
||||
tags: ['controller.service_arguments']
|
||||
|
||||
Chill\PersonBundle\Controller\TimelinePersonController:
|
||||
|
Loading…
x
Reference in New Issue
Block a user