private function normalizeLastIssuesByJournal(Journal $journal)
{
$this->io->newLine();
$this->io->text('normalizing last issue for ' . $journal->getTitle());
$this->io->progressAdvance();
$findLastIssue = $this->em->getRepository('OjsJournalBundle:Issue')->findOneBy(['journal' => $journal, 'lastIssue' => true]);
if ($findLastIssue) {
return true;
}
/** @var Issue|null $getLogicalLastIssue */
$getLogicalLastIssue = $this->em->getRepository('OjsJournalBundle:Issue')->getLastIssueByJournal($journal);
if ($getLogicalLastIssue == null) {
return null;
}
$getLogicalLastIssue->setLastIssue(true);
$this->em->flush();
}