private function processForm(ArticleAuthor $entity, array $parameters, $method = "PUT")
{
$form = $this->formFactory->create(new ArticleAuthorType(), $entity, array('method' => $method, 'csrf_protection' => false));
$form->submit($parameters, 'PATCH' !== $method);
$formData = $form->getData();
if ($form->isValid()) {
$entity->setArticle($this->getArticle());
$this->om->persist($entity);
$this->om->flush();
return $formData;
}
throw new InvalidFormException('Invalid submitted data', $form);
}