/**
  * @param FormValidationEvent $event
  */
 public function validateManageMenuItem(FormValidationEvent $event)
 {
     $formData = $event->getFormData();
     if ($this->acl->hasPermission('admin/menus/items/create') === true && isset($formData['create']) === true) {
         $event->getValidator()->addConstraint(NotEmptyValidationRule::class, ['data' => $formData, 'field' => 'menu_item_title', 'message' => $this->translator->t('menus', 'title_to_short')])->addConstraint(IntegerValidationRule::class, ['data' => $formData, 'field' => 'block_id', 'message' => $this->translator->t('menus', 'select_menu_bar')])->addConstraint(ParentIdValidationRule::class, ['data' => $formData, 'field' => 'parent_id', 'message' => $this->translator->t('menus', 'select_superior_page')])->addConstraint(InArrayValidationRule::class, ['data' => $formData, 'field' => 'display', 'message' => $this->translator->t('menus', 'select_item_visibility'), 'extra' => ['haystack' => [0, 1]]])->addConstraint(AllowedMenuValidationRule::class, ['data' => $formData, 'field' => ['parent_id', 'block_id'], 'message' => $this->translator->t('menus', 'superior_page_not_allowed')]);
     }
 }
 /**
  * @param FormValidationEvent $event
  */
 public function validateCaptcha(FormValidationEvent $event)
 {
     $event->getValidator()->addConstraint(CaptchaValidationRule::class, ['data' => $event->getFormData(), 'field' => 'captcha', 'message' => $this->translator->t('captcha', 'invalid_captcha_entered')]);
 }
 /**
  * @param FormValidationEvent $event
  */
 public function validateUriAlias(FormValidationEvent $event)
 {
     $event->getValidator()->addConstraint(UriAliasValidationRule::class, ['data' => $event->getFormData(), 'field' => 'alias', 'message' => $this->translator->t('seo', 'alias_unallowed_characters_or_exists'), 'extra' => $event->getExtra()]);
 }