public function updateAction(Request $request, $id, $articleId)
{
$journal = $this->get('ojs.journal_service')->getSelectedJournal();
$this->throw404IfNotFound($journal);
if (!$this->isGranted('EDIT', $journal, 'articles')) {
throw new AccessDeniedException("You not authorized for this page!");
}
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('OjsJournalBundle:Citation')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Citation entity.');
}
$editForm = $this->createEditForm($entity, $articleId);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
$em->flush();
return $this->redirect($this->generateUrl('ojs_journal_citation_edit', array('id' => $id, 'journalId' => $journal->getId(), 'articleId' => $articleId)));
}
return $this->render('OjsJournalBundle:Citation:edit.html.twig', array('entity' => $entity, 'edit_form' => $editForm->createView()));
}