Ojs\SiteBundle\Controller\JournalController::earlyPreviewIndexAction PHP Метод

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

public earlyPreviewIndexAction ( string $slug, boolean $isJournalHosting = false ) : Response
$slug string
$isJournalHosting boolean
Результат Symfony\Component\HttpFoundation\Response
    public function earlyPreviewIndexAction($slug, $isJournalHosting = false)
    {
        $em = $this->getDoctrine()->getManager();
        /** @var BlockRepository $blockRepo */
        $blockRepo = $em->getRepository('OjsJournalBundle:Block');
        /** @var Journal $journal */
        $journal = $em->getRepository('OjsJournalBundle:Journal')->findOneBy(['slug' => $slug]);
        $this->throw404IfNotFound($journal);
        if ($journal->getStatus() !== JournalStatuses::STATUS_PUBLISHED || $journal->getPublisher()->getStatus() !== PublisherStatuses::STATUS_COMPLETE) {
            $journal = null;
            $this->throw404IfNotFound($journal);
        }
        $articles = $em->getRepository(Article::class)->findBy(['journal' => $journal, 'status' => ArticleStatuses::STATUS_EARLY_PREVIEW]);
        $data = ['journal' => $journal, 'isJournalHosting' => $isJournalHosting, 'articles' => $articles, 'page' => 'journal', 'blocks' => $blockRepo->journalBlocks($journal)];
        return $this->render('OjsSiteBundle::Article/journal_articles.html.twig', $data);
    }