private function importCountry($name)
 {
     // geocode country
     $countryInfo = $this->geoInfo($name, array('featureClass' => 'A'));
     if (!is_object($countryInfo)) {
         $this->logError(array('geocode', 'country', $name));
         return;
     }
     $country = new Country();
     $country->setName($countryInfo->name);
     $country->setCountryCode(strtolower($countryInfo->countryCode));
     $country->setLat($countryInfo->lat);
     $country->setLng($countryInfo->lng);
     $this->getEntityManager()->persist($country);
     $this->getEntityManager()->flush($country);
     return $country;
 }
Пример #2
0
 function __toString()
 {
     return $this->getName() . ' (' . $this->country->getName() . ')';
 }