Importer/PKP/JournalUserImporter.php
private function getJournalUser(&$cache, $email, $journal)
    {
        if (!empty($cache[$email]['journal_user'])) {
            return $cache[$email]['journal_user'];
        }

        $journalUser = $this->em
            ->getRepository('VipaJournalBundle:JournalUser')
            ->findOneBy(['journal' => $journal, 'user' => $cache[$email]['user']]);

        if ($journalUser === null) {
            $journalUser = new JournalUser();
            $journalUser->setUser($cache[$email]['user']);
            $journalUser->setJournal($journal);
            $this->em->persist($journalUser);
        }

        $cache[$email]['journal_user'] = $journalUser;
        return $cache[$email]['journal_user'];
    }
private function getJournalUser(&$cache, $email, $journal)
    {
        if (!empty($cache[$email]['journal_user'])) {
            return $cache[$email]['journal_user'];
        }

        $journalUser = $this->em
            ->getRepository('VipaJournalBundle:JournalUser')
            ->findOneBy(['journal' => $journal, 'user' => $cache[$email]['user']]);

        if ($journalUser === null) {
            $journalUser = new JournalUser();
            $journalUser->setUser($cache[$email]['user']);
            $journalUser->setJournal($journal);
            $this->em->persist($journalUser);
        }

        $cache[$email]['journal_user'] = $journalUser;
        return $cache[$email]['journal_user'];
    }
private function getJournalUser ( & $ cache , $ email , $ journal ) { if ( ! empty ( $ cache [ $ email ] [ 'journal_user' ] ) ) { return $ cache [ $ email ] [ 'journal_user' ] ; } $ journalUser = $ this -> em -> getRepository ( 'VipaJournalBundle:JournalUser' ) -> findOneBy ( [ 'journal' => $ journal , 'user' => $ cache [ $ email ] [ 'user' ] ] ) ; if ( $ journalUser === null ) { $ journalUser = new JournalUser ( ) ; $ journalUser -> setUser ( $ cache [ $ email ] [ 'user' ] ) ; $ journalUser -> setJournal ( $ journal ) ; $ this -> em -> persist ( $ journalUser ) ; } $ cache [ $ email ] [ 'journal_user' ] = $ journalUser ; return $ cache [ $ email ] [ 'journal_user' ] ; }
Fetches the journal user
@param array $cache User cache
@param String $email User's email
@param Journal $journal Journal
@return JournalUser Imported or retrieved JournalUser
Fetches the journal user