public function archiveIndexAction(Request $request, $slug, $isJournalHosting = false)
{
/**
* @todo we should check if it is base domain initialized
*/
$currentHost = $request->getHttpHost();
/*
$base_host = $container->getParameter('base_host');
if($currentHost == $base_host){
$this->throw404IfNotFound(0);
}
*/
$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);
}
$data['groupedIssues'] = $em->getRepository(Issue::class)->getByYear($journal, true);
$data['page'] = 'archive';
$data['blocks'] = $blockRepo->journalBlocks($journal);
$data['journal'] = $journal;
$data['isJournalHosting'] = $isJournalHosting;
$data['displayModes'] = ['all' => IssueDisplayModes::SHOW_ALL, 'title' => IssueDisplayModes::SHOW_TITLE, 'volumeAndNumber' => IssueDisplayModes::SHOW_VOLUME_AND_NUMBER];
return $this->render('OjsSiteBundle::Journal/archive_index.html.twig', $data);
}