Ojs\AdminBundle\Controller\AdminPublisherApplicationController::deleteAction PHP Method

deleteAction() public method

public deleteAction ( Request $request, $id )
$request Symfony\Component\HttpFoundation\Request
    public function deleteAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();
        /** @var Publisher $entity */
        $entity = $em->getRepository('OjsJournalBundle:Publisher')->find($id);
        $this->throw404IfNotFound($entity);
        $csrf = $this->get('security.csrf.token_manager');
        $token = $csrf->getToken('ojs_admin_application_publisher' . $id);
        if ($token != $request->get('_token')) {
            throw new TokenNotFoundException("Token Not Found!");
        }
        $this->get('ojs_core.delete.service')->check($entity);
        $em->remove($entity);
        $em->flush();
        return $this->redirectToRoute('ojs_admin_application_publisher_index');
    }