eZ\Publish\Core\Repository\Repository::getLocationService PHP Метод

getLocationService() публичный Метод

Get service object to perform operations on Location objects and subtrees
public getLocationService ( ) : eZ\Publish\API\Repository\LocationService
Результат 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;
    }

Usage Example

Пример #1
0
 /**
  * @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();
 }
All Usage Examples Of eZ\Publish\Core\Repository\Repository::getLocationService