Esempio n. 1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $em = $this->getContainer()->get("doctrine.orm.entity_manager");
     $country = new Country();
     $country->setName("Россия");
     $em->persist($country);
     $em->flush();
     foreach ($this->citys as $name) {
         $role = new City();
         $role->setCountry($country);
         $role->setName($name);
         $em->persist($role);
     }
     $em->flush();
 }