public function deleteAction(Request $request, AdminPage $entity)
{
$this->throw404IfNotFound($entity);
$em = $this->getDoctrine()->getManager();
$csrf = $this->get('security.csrf.token_manager');
$token = $csrf->getToken('ojs_admin_page' . $entity->getId());
if ($token != $request->get('_token')) {
throw new TokenNotFoundException("Token not found!");
}
$this->get('ojs_core.delete.service')->check($entity);
$em->remove($entity);
$em->flush();
$this->successFlashBag('successful.remove');
return $this->redirectToRoute('ojs_admin_page_index');
}