public function editAction($id)
{
/** @var JournalAnnouncement $entity */
$journal = $this->get('ojs.journal_service')->getSelectedJournal();
$entity = $this->getDoctrine()->getRepository('OjsJournalBundle:JournalAnnouncement')->find($id);
$this->throw404IfNotFound($entity);
if (!$this->isGranted('EDIT', $journal, 'announcements')) {
throw new AccessDeniedException("You are not authorized for this page!");
}
$token = $this->get('security.csrf.token_manager')->refreshToken('ojs_journal_announcement' . $entity->getId());
$editForm = $this->createEditForm($entity);
return $this->render('OjsJournalBundle:JournalAnnouncement:edit.html.twig', ['token' => $token, 'entity' => $entity, 'edit_form' => $editForm->createView()]);
}