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\Repository\PersonRepository;
|
||||||
use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper;
|
use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PersonController
|
* Class PersonController
|
||||||
@ -76,6 +77,12 @@ class PersonController extends AbstractController
|
|||||||
*/
|
*/
|
||||||
protected $configPersonAltNameHelper;
|
protected $configPersonAltNameHelper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @var EntityManagerInterface
|
||||||
|
*/
|
||||||
|
protected $em;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Psr\Log\LoggerInterface
|
* @var \Psr\Log\LoggerInterface
|
||||||
*/
|
*/
|
||||||
@ -93,7 +100,8 @@ class PersonController extends AbstractController
|
|||||||
PersonRepository $personRepository,
|
PersonRepository $personRepository,
|
||||||
ConfigPersonAltNamesHelper $configPersonAltNameHelper,
|
ConfigPersonAltNamesHelper $configPersonAltNameHelper,
|
||||||
LoggerInterface $logger,
|
LoggerInterface $logger,
|
||||||
ValidatorInterface $validator
|
ValidatorInterface $validator,
|
||||||
|
EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
$this->similarPersonMatcher = $similarPersonMatcher;
|
$this->similarPersonMatcher = $similarPersonMatcher;
|
||||||
$this->translator = $translator;
|
$this->translator = $translator;
|
||||||
@ -102,6 +110,7 @@ class PersonController extends AbstractController
|
|||||||
$this->personRepository = $personRepository;
|
$this->personRepository = $personRepository;
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
$this->validator = $validator;
|
$this->validator = $validator;
|
||||||
|
$this->em = $em;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCFGroup()
|
public function getCFGroup()
|
||||||
@ -343,6 +352,8 @@ class PersonController extends AbstractController
|
|||||||
$this->logger->info('Person created without errors');
|
$this->logger->info('Person created without errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->em->persist($person);
|
||||||
|
|
||||||
$alternatePersons = $this->similarPersonMatcher
|
$alternatePersons = $this->similarPersonMatcher
|
||||||
->matchPerson($person);
|
->matchPerson($person);
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ services:
|
|||||||
$configPersonAltNameHelper: '@Chill\PersonBundle\Config\ConfigPersonAltNamesHelper'
|
$configPersonAltNameHelper: '@Chill\PersonBundle\Config\ConfigPersonAltNamesHelper'
|
||||||
$logger: '@Psr\Log\LoggerInterface'
|
$logger: '@Psr\Log\LoggerInterface'
|
||||||
$validator: '@Symfony\Component\Validator\Validator\ValidatorInterface'
|
$validator: '@Symfony\Component\Validator\Validator\ValidatorInterface'
|
||||||
|
$em: '@Doctrine\ORM\EntityManagerInterface'
|
||||||
tags: ['controller.service_arguments']
|
tags: ['controller.service_arguments']
|
||||||
|
|
||||||
Chill\PersonBundle\Controller\TimelinePersonController:
|
Chill\PersonBundle\Controller\TimelinePersonController:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user