/** * @param stdClass $item * @param \Application_Model_Geocoder_Location_LatLng $LatLang * @return Application_Model_Geocoder_Location */ private function _initLocation(stdClass $item, Application_Model_Geocoder_Location_LatLng $LatLang) { if (!empty($item->types)) { $type = $this->_convertType($item->types[0]); if (!$type) { // if not empty type return null; } $location = !is_null($this->parentLocation) ? $this->parentLocation->addChildrenLocation($LatLang, $type) : Application_Model_Geocoder_Location::createLocation(0, $LatLang, $type); $location->setLocationName($this->getLang(), $item->long_name); $location->save(); return $location; } }