public function updateAction(Request $request, Block $entity)
{
$journal = $this->get('ojs.journal_service')->getSelectedJournal();
if (!$this->isGranted('EDIT', $journal, 'block')) {
throw new AccessDeniedException("You not authorized for edit this page!");
}
$em = $this->getDoctrine()->getManager();
$editForm = $this->createEditForm($entity);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
$em->persist($entity);
$em->flush();
$this->successFlashBag('successful.update');
return $this->redirectToRoute('ojs_journal_block_edit', ['id' => $entity->getId(), 'journalId' => $journal->getId()]);
}
return $this->render('OjsJournalBundle:Block:edit.html.twig', array('entity' => $entity, 'edit_form' => $editForm->createView()));
}