public function validateForm(FormEvent
$event) { $form =
$event->
getForm();
if ($form->
isRoot()) { // Form groups are validated internally (FormValidator). Here we don't set groups as they are retrieved into the validator.
foreach ($this->validator->
validate($form) as $violation) { // Allow the "invalid" constraint to be put onto
// non-synchronized forms
$allowNonSynchronized =
$violation->
getConstraint() instanceof Form && Form::NOT_SYNCHRONIZED_ERROR ===
$violation->
getCode();
$this->violationMapper->
mapViolation($violation,
$form,
$allowNonSynchronized);
} } }}