public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
/** @var Journal $entity */
$entity = $em->getRepository('OjsJournalBundle:Journal')->find($id);
$this->throw404IfNotFound($entity);
/** @var $dispatcher EventDispatcherInterface */
$dispatcher = $this->get('event_dispatcher');
$editForm = $this->createEditForm($entity);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
$em->persist($entity);
$em->flush();
$this->successFlashBag('successful.update');
$event = new AdminEvent(['eventType' => 'update', 'entity' => $entity]);
$dispatcher->dispatch(AdminEvents::ADMIN_JOURNAL_CHANGE, $event);
return $this->redirectToRoute('ojs_admin_journal_edit', ['id' => $id]);
}
return $this->render('OjsAdminBundle:AdminJournal:edit.html.twig', array('entity' => $entity, 'edit_form' => $editForm->createView()));
}