public function deleteAction(Request $request, PublisherTheme $entity, $publisherId)
{
$em = $this->getDoctrine()->getManager();
$publisher = $em->getRepository('OjsJournalBundle:Publisher')->find($publisherId);
$this->throw404IfNotFound($publisher);
if (!$this->isGrantedForPublisher($publisher)) {
throw new AccessDeniedException("You are not authorized for this page!");
}
$this->throw404IfNotFound($entity);
$em = $this->getDoctrine()->getManager();
$csrf = $this->get('security.csrf.token_manager');
$token = $csrf->getToken('ojs_publisher_manager_theme' . $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_publisher_manager_theme_index', ['publisherId' => $publisherId]);
}