Ojs\CoreBundle\Command\InstitutionSamplesCommand::execute PHP Метод

execute() защищенный Метод

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : integer | null | void
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
Результат integer | null | void
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('Creating sample institutions...');
        $getInstitutions = $this->getInstitutionsFromFile($input, $output);
        $findCountry = $this->em->getRepository('BulutYazilimLocationBundle:Country')->find($this->getContainer()->getParameter('country_id'));
        foreach ($getInstitutions as $institutionName) {
            $institutionName = trim($institutionName);
            $output->writeln($institutionName);
            $institution = new Institution();
            $institution->setName($institutionName);
            $institution->setCountry($findCountry);
            $this->em->persist($institution);
        }
        $this->em->flush();
    }