Ojs\CoreBundle\Command\NormalizeLastIssuesCommand::normalizeLastIssuesByJournal PHP Method

normalizeLastIssuesByJournal() private method

private normalizeLastIssuesByJournal ( Journal $journal ) : boolean | null
$journal Ojs\JournalBundle\Entity\Journal
return boolean | null
    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();
    }