public function onSubmit(FormEvent $event): void
{
/** @var ENP0026MeBox $meBox */
$meBox = $event->getData();
$form = $event->getForm();
if (!$meBox->isActive()) {
return;
}
$requiredFormData[] = $form['code'];
$requiredFormData[] = $form['address']['street'];
$requiredFormData[] = $form['address']['houseNumber'];
$requiredFormData[] = $form['address']['lat'];
$requiredFormData[] = $form['address']['lng'];
foreach ($requiredFormData as $single) {
if (empty($single->getData())) {
$single->addError(
new FormError($this->translator->trans('pos.me_box_required_field', [], 'EnpPOSBundle'))
);
}
}
}