Exemplo n.º 1
0
 private function _setData(stdClass $data)
 {
     $this->__setContentFields();
     $search = new Application_Model_Geocoder_Location_Search_Location();
     $address = $search->findLocationByLatLng($data->city_location['lat'], $data->city_location['lng'], Application_Model_Geocoder_Location::TYPE_LOCALITY);
     if (!$address instanceof Application_Model_Geocoder_Location_Address) {
         throw new Exception('Location not found');
     }
     $this->_entity->setLocation($address->getCity());
     $this->_entity->setLocationLat($data->city_location['lat']);
     $this->_entity->setLocationLng($data->city_location['lng']);
     $this->_entity->setLocationZoom($data->city_location['zoom']);
 }