Beispiel #1
0
 /**
  * Load data fixtures with the passed EntityManager
  *
  * @param ObjectManager $manager
  */
 public function load(ObjectManager $manager)
 {
     $countries = $manager->getRepository('SehBundle:Country')->findAll();
     foreach ($countries as $country) {
         $countryBrand = new Country();
         $countryBrand->setCountry($country);
         $manager->persist($countryBrand);
     }
     $regions = $manager->getRepository('SehBundle:Region')->findAll();
     foreach ($regions as $region) {
         $regionBrand = new Region();
         $regionBrand->setRegion($region);
         $manager->persist($regionBrand);
     }
     $departments = $manager->getRepository('SehBundle:Department')->findAll();
     foreach ($departments as $department) {
         $departmentBrand = new Department();
         $departmentBrand->setDepartment($department);
         $manager->persist($departmentBrand);
     }
     $thematics = $manager->getRepository('SehBundle:Thematic')->findAll();
     foreach ($thematics as $thematic) {
         $thematicBrand = new Thematic();
         $thematicBrand->setThematic($thematic);
         $manager->persist($thematicBrand);
     }
     $cities = $manager->getRepository('SehBundle:City')->findAll();
     foreach ($cities as $city) {
         $cityBrand = new City();
         $cityBrand->setCity($city);
         $manager->persist($cityBrand);
     }
     $manager->flush();
 }