예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function isSubmitted(FormInterface $form)
 {
     $hasAttribute = $this->request->request->has(sprintf('%s_submitted', $form->getName()));
     $isValidMethod = $this->request->isMethod($form->getOption('method'));
     return $hasAttribute && $isValidMethod;
 }
 /**
  * Dispatches a form event
  *
  * @param FormInterface        $form
  * @param EntityInterface|null $entity
  * @param string               $name
  */
 protected function dispatchFormEvent(FormInterface $form, EntityInterface $entity = null, string $name)
 {
     $eventName = sprintf('%s.%s', $form->getOption('name'), $name);
     $this->eventDispatcher->dispatch($eventName, new FormEvent($this, $form, $entity));
 }