public function updateAction(Request $request, AdminPost $entity)
{
$this->throw404IfNotFound($entity);
$em = $this->getDoctrine()->getManager();
$editForm = $this->createEditForm($entity);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
$em->flush();
$this->successFlashBag('successful.update');
return $this->redirectToRoute('ojs_admin_post_edit', ['id' => $entity->getId()]);
}
$token = $this->get('security.csrf.token_manager')->refreshToken('ojs_admin_post' . $entity->getId());
return $this->render('OjsAdminBundle:AdminPost:edit.html.twig', array('token' => $token, 'entity' => $entity, 'edit_form' => $editForm->createView()));
}