mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Merge branch 'master' into _8_entity_parcours
This commit is contained in:
@@ -34,6 +34,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Validator\ConstraintViolationListInterface;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
|
||||
/**
|
||||
* Class AccompanyingPeriodController
|
||||
@@ -48,13 +49,20 @@ class AccompanyingPeriodController extends AbstractController
|
||||
protected $eventDispatcher;
|
||||
|
||||
/**
|
||||
* ReportController constructor.
|
||||
* @var ValidatorInterface
|
||||
*/
|
||||
protected $validator;
|
||||
|
||||
/**
|
||||
* AccompanyingPeriodController constructor.
|
||||
*
|
||||
* @param EventDispatcherInterface $eventDispatcher
|
||||
* @param ValidatorInterface $validator
|
||||
*/
|
||||
public function __construct(EventDispatcherInterface $eventDispatcher)
|
||||
public function __construct(EventDispatcherInterface $eventDispatcher, ValidatorInterface $validator)
|
||||
{
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
$this->validator = $validator;
|
||||
}
|
||||
|
||||
public function listAction(int $person_id): Response
|
||||
@@ -282,9 +290,10 @@ class AccompanyingPeriodController extends AbstractController
|
||||
|
||||
private function _validatePerson(Person $person): ConstraintViolationListInterface
|
||||
{
|
||||
$errors = $this->get('validator')->validate($person, null,
|
||||
$errors = $this->validator->validate($person, null,
|
||||
['Default']);
|
||||
$errors_accompanying_period = $this->get('validator')->validate($person, null,
|
||||
|
||||
$errors_accompanying_period = $this->validator->validate($person, null,
|
||||
['accompanying_period_consistent']);
|
||||
|
||||
foreach($errors_accompanying_period as $error ) {
|
||||
|
Reference in New Issue
Block a user