Importer/PKP/JournalImporter.php
private function importAndSetPublisher($name, $locale)
    {
        $translation = $this->em
            ->getRepository('VipaJournalBundle:PublisherTranslation')
            ->findOneBy(['name' => $name]);
        $publisher = $translation !== null ? $translation->getTranslatable() : null;

        if (!$publisher) {
            $url = !empty($this->settings[$locale]['publisherUrl']) ? $this->settings[$locale]['publisherUrl'] : null;
            $publisher = $this->createPublisher($this->settings[$locale]['publisherInstitution'], $url, $locale);
            $publisher->setStatus(PublisherStatuses::STATUS_COMPLETE);

            foreach ($this->settings as $fieldLocale => $fields) {
                $publisher->setCurrentLocale(mb_substr($fieldLocale, 0, 2, 'UTF-8'));
                !empty($fields['publisherNote']) ?
                    $publisher->setAbout($fields['publisherNote']) :
                    $publisher->setAbout('-');
            }
        }

        $this->journal->setPublisher($publisher);
    }
private function importAndSetPublisher($name, $locale)
    {
        $translation = $this->em
            ->getRepository('VipaJournalBundle:PublisherTranslation')
            ->findOneBy(['name' => $name]);
        $publisher = $translation !== null ? $translation->getTranslatable() : null;

        if (!$publisher) {
            $url = !empty($this->settings[$locale]['publisherUrl']) ? $this->settings[$locale]['publisherUrl'] : null;
            $publisher = $this->createPublisher($this->settings[$locale]['publisherInstitution'], $url, $locale);
            $publisher->setStatus(PublisherStatuses::STATUS_COMPLETE);

            foreach ($this->settings as $fieldLocale => $fields) {
                $publisher->setCurrentLocale(mb_substr($fieldLocale, 0, 2, 'UTF-8'));
                !empty($fields['publisherNote']) ?
                    $publisher->setAbout($fields['publisherNote']) :
                    $publisher->setAbout('-');
            }
        }

        $this->journal->setPublisher($publisher);
    }
private function importAndSetPublisher ( $ name , $ locale ) { $ translation = $ this -> em -> getRepository ( 'VipaJournalBundle:PublisherTranslation' ) -> findOneBy ( [ 'name' => $ name ] ) ; $ publisher = $ translation !== null ? $ translation -> getTranslatable ( ) : null ; if ( ! $ publisher ) { $ url = ! empty ( $ this -> settings [ $ locale ] [ 'publisherUrl' ] ) ? $ this -> settings [ $ locale ] [ 'publisherUrl' ] : null ; $ publisher = $ this -> createPublisher ( $ this -> settings [ $ locale ] [ 'publisherInstitution' ] , $ url , $ locale ) ; $ publisher -> setStatus ( PublisherStatuses :: STATUS_COMPLETE ) ; foreach ( $ this -> settings as $ fieldLocale => $ fields ) { $ publisher -> setCurrentLocale ( mb_substr ( $ fieldLocale , 0 , 2 , 'UTF-8' ) ) ; ! empty ( $ fields [ 'publisherNote' ] ) ? $ publisher -> setAbout ( $ fields [ 'publisherNote' ] ) : $ publisher -> setAbout ( '-' ) ; } } $ this -> journal -> setPublisher ( $ publisher ) ; }
Imports the publisher with given name and assigns it to
the journal. It uses the one from the database in case
it exists.
@param String $name Publisher's name
@param String $locale Locale of the settings
Imports the publisher with given name and assigns it to the journal . It uses the one from the database in case it exists .