Ojs\CoreBundle\Command\NormalizeTranslatableObjectsCommand::normalizePublisherTypes PHP Метод

normalizePublisherTypes() приватный Метод

    private function normalizePublisherTypes()
    {
        $this->io->newLine();
        $this->io->text('normalizing publisher types');
        $this->getContainer()->getParameter('locale');
        $this->io->progressStart();
        $publisherTypes = $this->em->getRepository('OjsJournalBundle:PublisherTypes')->findAll();
        foreach ($publisherTypes as $publisherType) {
            $getTranslation = $this->em->getRepository('OjsJournalBundle:PublisherTypesTranslation')->findOneBy(['translatable' => $publisherType, 'locale' => $this->locale]);
            if (!$getTranslation) {
                $this->io->progressAdvance();
                $newPublisherTypeTranslation = new PublisherTypesTranslation();
                $newPublisherTypeTranslation->setTranslatable($publisherType);
                $newPublisherTypeTranslation->setLocale($this->locale);
                $newPublisherTypeTranslation->setName('-');
                $this->em->persist($newPublisherTypeTranslation);
            }
        }
        $this->em->flush();
        $this->io->newLine();
    }