Ojs\JournalBundle\Controller\IssueController::removeArticleAction PHP Метод

removeArticleAction() публичный Метод

Remove article fro this issue
public removeArticleAction ( Request $request, integer $id, integer $articleId ) : RedirectResponse
$request Symfony\Component\HttpFoundation\Request
$id integer
$articleId integer
Результат Symfony\Component\HttpFoundation\RedirectResponse
    public function removeArticleAction(Request $request, $id, $articleId)
    {
        $journal = $this->get('ojs.journal_service')->getSelectedJournal();
        if (!$this->isGranted('EDIT', $journal, 'issues')) {
            throw new AccessDeniedException("You are not authorized for edit this journal's issue!");
        }
        $referrer = $request->headers->get('referer');
        $em = $this->getDoctrine()->getManager();
        $issue = $em->getRepository('OjsJournalBundle:Issue')->find($id);
        $this->throw404IfNotFound($issue);
        /** @var Article $article */
        $article = $em->getRepository('OjsJournalBundle:Article')->find($articleId);
        $this->throw404IfNotFound($article);
        $article->setIssue(null);
        $em->persist($article);
        $em->flush();
        $this->successFlashBag('successful.remove');
        return $this->redirect($referrer);
    }