Merge branch 'master' into _8_entity_parcours

This commit is contained in:
2021-03-30 11:21:06 +02:00
77 changed files with 8081 additions and 20 deletions

View File

@@ -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 ) {