Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function format($format)
 {
     return strtr($format, array(FormatterInterface::STREET_NUMBER => $this->result->getStreetNumber(), FormatterInterface::STREET_NAME => $this->result->getStreetName(), FormatterInterface::CITY => $this->result->getCity(), FormatterInterface::ZIPCODE => $this->result->getZipcode(), FormatterInterface::CITY_DISTRICT => $this->result->getCityDistrict(), FormatterInterface::COUNTY => $this->result->getCounty(), FormatterInterface::COUNTY_CODE => $this->result->getCountyCode(), FormatterInterface::REGION => $this->result->getRegion(), FormatterInterface::REGION_CODE => $this->result->getRegionCode(), FormatterInterface::COUNTRY => $this->result->getCountry(), FormatterInterface::COUNTRY_CODE => $this->result->getCountryCode(), FormatterInterface::TIMEZONE => $this->result->getTimezone()));
 }
 /**
  * @param ResultInterface $result
  *
  * @return Address
  */
 public function geocoderResultToAddress(ResultInterface $result)
 {
     $address = new Address();
     $address->setCity($result->getCity());
     $address->setCountry($result->getCountry());
     $address->setCountryCode($result->getCountryCode());
     $address->setRegion($result->getRegion());
     $address->setRegionCode($result->getRegionCode());
     $address->setCounty($result->getCounty());
     $address->setCountyCode($result->getCountyCode());
     $address->setLat($result->getLatitude());
     $address->setLng($result->getLongitude());
     $address->setPostalCode($result->getZipcode());
     $address->setStreetName($result->getStreetName());
     $address->setStreetNumber($result->getStreetNumber());
     $this->addressManager->updateFormattedAddress($address);
     return $address;
 }