public getLocationService ( ) : eZ\Publish\API\Repository\LocationService | ||
return | eZ\Publish\API\Repository\LocationService |
public function getLocationService()
{
if ($this->locationService !== null) {
return $this->locationService;
}
$this->locationService = new LocationService($this, $this->persistenceHandler, $this->getDomainMapper(), $this->getNameSchemaService(), $this->getPermissionsCriterionHandler(), $this->serviceSettings['location']);
return $this->locationService;
}
/** * @param SearchResult $searchResult * @return Location * @throws LocationNotFoundException */ protected function fetchSingleLocationFromSearchResult($searchResult) { foreach ($searchResult->searchHits as $searchHit) { /** @var Location $location */ $location = $searchHit->valueObject; return $this->repository->getLocationService()->loadLocation($location->id); } throw new LocationNotFoundException(); }