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