protected function getLocation(Document $document, $sm) 
	{
		$main = $sm->get('neobazaar.service.main');
		$location = $document->getGeoname();
		if(null !== $location) {
			if('ADM3' == $location->getFeatureCode()) {
				$location = $main->getGeonamesEntityRepository()->getParent($location);
			}
		}
		
		return null !== $location ? $location->getUrl() : '';
	}
protected function getLocation(Document $document, $sm) 
	{
		$main = $sm->get('neobazaar.service.main');
		$location = $document->getGeoname();
		if(null !== $location) {
			if('ADM3' == $location->getFeatureCode()) {
				$location = $main->getGeonamesEntityRepository()->getParent($location);
			}
		}
		
		return null !== $location ? $location->getUrl() : '';
	}
protected function getLocation ( Document $ document , $ sm ) { $ main = $ sm -> get ( 'neobazaar.service.main' ) ; $ location = $ document -> getGeoname ( ) ; if ( null !== $ location ) { if ( 'ADM3' == $ location -> getFeatureCode ( ) ) { $ location = $ main -> getGeonamesEntityRepository ( ) -> getParent ( $ location ) ; } } return null !== $ location ? $ location -> getUrl ( ) : '' ; }
Get the classified location.
To make the ADM2 select populated it will use the parent
entity if the location is an ADM3

@param Document $document
@return string
Get the classified location . To make the ADM2 select populated it will use the parent entity if the location is an ADM3