Пример #1
0
 protected function loadContinents()
 {
     $fixtures = array(array(6255148, 'EU', 'Europe'));
     foreach ($fixtures as $c) {
         $continent = new Continent($this->om->find('Giosh94mhzGeonamesBundle:Toponym', $c[0]));
         $continent->setCode($c[1])->setName($c[2]);
         $this->om->persist($continent);
     }
 }
 public function buildEntity($value)
 {
     /* @var $continent \Giosh94mhz\GeonamesBundle\Entity\Continent */
     $continent = $this->repository->find($value[2]);
     if (!$continent) {
         /* @var $toponym \Giosh94mhz\GeonamesBundle\Entity\Toponym */
         $toponym = $this->toponymRepository->find($value[2]) ?: $this->createFallbackToponym($value[0], $value[1], $value[2]);
         $continent = new Continent($toponym);
     }
     $continent->setCode($value[0])->setName($value[1]);
     return $continent;
 }