Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Core/Repository/SiteAccessAware/LocationService.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Repository\SiteAccessAware;
8
9 use eZ\Publish\API\Repository\LocationService as LocationServiceInterface;
10 use eZ\Publish\API\Repository\Values\Content\Location;
11 use eZ\Publish\API\Repository\Values\Content\ContentInfo;
12 use eZ\Publish\API\Repository\Values\Content\VersionInfo;
13 use eZ\Publish\API\Repository\Values\Content\LocationCreateStruct;
14 use eZ\Publish\API\Repository\Values\Content\LocationUpdateStruct;
15 use eZ\Publish\API\Repository\LanguageResolver;
16
22 class LocationService implements LocationServiceInterface
23 {
25 protected $service;
26
28 protected $languageResolver;
29
36 public function __construct(
37 LocationServiceInterface $service,
38 LanguageResolver $languageResolver
39 ) {
40 $this->service = $service;
41 $this->languageResolver = $languageResolver;
42 }
43
44 public function copySubtree(Location $subtree, Location $targetParentLocation)
45 {
46 return $this->service->copySubtree($subtree, $targetParentLocation);
47 }
48
49 public function loadLocation($locationId, array $prioritizedLanguages = null, bool $useAlwaysAvailable = null)
50 {
51 return $this->service->loadLocation(
52 $locationId,
53 $this->languageResolver->getPrioritizedLanguages($prioritizedLanguages),
54 $this->languageResolver->getUseAlwaysAvailable($useAlwaysAvailable)
55 );
56 }
57
58 public function loadLocationList(array $locationIds, array $prioritizedLanguages = null, bool $useAlwaysAvailable = null): iterable
59 {
60 return $this->service->loadLocationList(
61 $locationIds,
62 $this->languageResolver->getPrioritizedLanguages($prioritizedLanguages),
63 $this->languageResolver->getUseAlwaysAvailable($useAlwaysAvailable)
64 );
65 }
66
67 public function loadLocationByRemoteId($remoteId, array $prioritizedLanguages = null, bool $useAlwaysAvailable = null)
68 {
69 return $this->service->loadLocationByRemoteId(
70 $remoteId,
71 $this->languageResolver->getPrioritizedLanguages($prioritizedLanguages),
72 $this->languageResolver->getUseAlwaysAvailable($useAlwaysAvailable)
73 );
74 }
75
76 public function loadLocations(ContentInfo $contentInfo, Location $rootLocation = null, array $prioritizedLanguages = null)
77 {
78 return $this->service->loadLocations(
79 $contentInfo,
80 $rootLocation,
81 $this->languageResolver->getPrioritizedLanguages($prioritizedLanguages)
82 );
83 }
84
85 public function loadLocationChildren(Location $location, $offset = 0, $limit = 25, array $prioritizedLanguages = null)
86 {
87 return $this->service->loadLocationChildren(
88 $location,
89 $offset,
90 $limit,
91 $this->languageResolver->getPrioritizedLanguages($prioritizedLanguages)
92 );
93 }
94
95 public function loadParentLocationsForDraftContent(VersionInfo $versionInfo, array $prioritizedLanguages = null)
96 {
97 return $this->service->loadParentLocationsForDraftContent(
98 $versionInfo,
99 $this->languageResolver->getPrioritizedLanguages($prioritizedLanguages)
100 );
101 }
102
103 public function getLocationChildCount(Location $location)
104 {
105 return $this->service->getLocationChildCount($location);
106 }
107
108 public function createLocation(ContentInfo $contentInfo, LocationCreateStruct $locationCreateStruct)
109 {
110 return $this->service->createLocation($contentInfo, $locationCreateStruct);
111 }
112
113 public function updateLocation(Location $location, LocationUpdateStruct $locationUpdateStruct)
114 {
115 return $this->service->updateLocation($location, $locationUpdateStruct);
116 }
117
118 public function swapLocation(Location $location1, Location $location2)
119 {
120 return $this->service->swapLocation($location1, $location2);
121 }
122
123 public function hideLocation(Location $location)
124 {
125 return $this->service->hideLocation($location);
126 }
127
128 public function unhideLocation(Location $location)
129 {
130 return $this->service->unhideLocation($location);
131 }
132
133 public function moveSubtree(Location $location, Location $newParentLocation)
134 {
135 return $this->service->moveSubtree($location, $newParentLocation);
136 }
137
138 public function deleteLocation(Location $location)
139 {
140 $this->service->deleteLocation($location);
141 }
142
143 public function newLocationCreateStruct($parentLocationId)
144 {
145 return $this->service->newLocationCreateStruct($parentLocationId);
146 }
147
148 public function newLocationUpdateStruct()
149 {
150 return $this->service->newLocationUpdateStruct();
151 }
152
160 public function getAllLocationsCount(): int
161 {
162 return $this->service->getAllLocationsCount();
163 }
164
173 public function loadAllLocations(int $offset = 0, int $limit = 25): array
174 {
175 return $this->service->loadAllLocations($offset, $limit);
176 }
177 }
eZ\Publish\API\Repository\Values\Content\ContentInfo
Definition: API/Repository/Values/Content/ContentInfo.php:31
eZ\Publish\API\Repository\Values\Content\LocationCreateStruct
This class is used to create a new Location for a content object.
Definition: API/Repository/Values/Content/LocationCreateStruct.php:15
eZ\Publish\API\Repository\Values\Content\LocationUpdateStruct
This class is used for updating location meta data.
Definition: API/Repository/Values/Content/LocationUpdateStruct.php:15
eZ\Publish\API\Repository\Values\Content\Location
Definition: API/Repository/Values/Content/Location.php:32
eZ\Publish\API\Repository\Values\Content\VersionInfo
Definition: API/Repository/Values/Content/VersionInfo.php:27
eZ\Publish\Core\Repository\SiteAccessAware\LocationService
LocationService for SiteAccessAware layer.
Definition: Core/Repository/SiteAccessAware/LocationService.php:23
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\loadAllLocations
loadAllLocations(int $offset=0, int $limit=25)
Bulk-load all existing Locations, constrained by $limit and $offset to paginate results.
Definition: Core/Repository/SiteAccessAware/LocationService.php:173
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\__construct
__construct(LocationServiceInterface $service, LanguageResolver $languageResolver)
Construct service object from aggregated service and LanguageResolver.
Definition: Core/Repository/SiteAccessAware/LocationService.php:36
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\loadLocationChildren
loadLocationChildren(Location $location, $offset=0, $limit=25, array $prioritizedLanguages=null)
Loads children which are readable by the current user of a location object sorted by sortField and so...
Definition: Core/Repository/SiteAccessAware/LocationService.php:85
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\newLocationUpdateStruct
newLocationUpdateStruct()
Instantiates a new location update class.
Definition: Core/Repository/SiteAccessAware/LocationService.php:148
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\moveSubtree
moveSubtree(Location $location, Location $newParentLocation)
Moves the subtree to $newParentLocation.
Definition: Core/Repository/SiteAccessAware/LocationService.php:133
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\getLocationChildCount
getLocationChildCount(Location $location)
Returns the number of children which are readable by the current user of a location object.
Definition: Core/Repository/SiteAccessAware/LocationService.php:103
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\loadParentLocationsForDraftContent
loadParentLocationsForDraftContent(VersionInfo $versionInfo, array $prioritizedLanguages=null)
Load parent Locations for Content Draft.
Definition: Core/Repository/SiteAccessAware/LocationService.php:95
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\$service
$service
Definition: Core/Repository/SiteAccessAware/LocationService.php:25
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\newLocationCreateStruct
newLocationCreateStruct($parentLocationId)
Instantiates a new location create class.
Definition: Core/Repository/SiteAccessAware/LocationService.php:143
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\swapLocation
swapLocation(Location $location1, Location $location2)
Swaps the contents held by $location1 and $location2.
Definition: Core/Repository/SiteAccessAware/LocationService.php:118
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\copySubtree
copySubtree(Location $subtree, Location $targetParentLocation)
Copies the subtree starting from $subtree as a new subtree of $targetLocation.
Definition: Core/Repository/SiteAccessAware/LocationService.php:44
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\getAllLocationsCount
getAllLocationsCount()
Get the total number of all existing Locations.
Definition: Core/Repository/SiteAccessAware/LocationService.php:160
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\$languageResolver
$languageResolver
Definition: Core/Repository/SiteAccessAware/LocationService.php:28
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\loadLocation
loadLocation($locationId, array $prioritizedLanguages=null, bool $useAlwaysAvailable=null)
Loads a location object from its $locationId.
Definition: Core/Repository/SiteAccessAware/LocationService.php:49
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\updateLocation
updateLocation(Location $location, LocationUpdateStruct $locationUpdateStruct)
Updates $location in the content repository.
Definition: Core/Repository/SiteAccessAware/LocationService.php:113
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\loadLocations
loadLocations(ContentInfo $contentInfo, Location $rootLocation=null, array $prioritizedLanguages=null)
Loads the locations for the given content object.
Definition: Core/Repository/SiteAccessAware/LocationService.php:76
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\loadLocationByRemoteId
loadLocationByRemoteId($remoteId, array $prioritizedLanguages=null, bool $useAlwaysAvailable=null)
Loads a location object from its $remoteId.
Definition: Core/Repository/SiteAccessAware/LocationService.php:67
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\createLocation
createLocation(ContentInfo $contentInfo, LocationCreateStruct $locationCreateStruct)
Creates the new $location in the content repository for the given content.
Definition: Core/Repository/SiteAccessAware/LocationService.php:108
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\deleteLocation
deleteLocation(Location $location)
Deletes $location and all its descendants.
Definition: Core/Repository/SiteAccessAware/LocationService.php:138
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\loadLocationList
loadLocationList(array $locationIds, array $prioritizedLanguages=null, bool $useAlwaysAvailable=null)
Loads several location objects from its $locationIds.
Definition: Core/Repository/SiteAccessAware/LocationService.php:58
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\unhideLocation
unhideLocation(Location $location)
Unhides the $location.
Definition: Core/Repository/SiteAccessAware/LocationService.php:128
eZ\Publish\Core\Repository\SiteAccessAware\LocationService\hideLocation
hideLocation(Location $location)
Hides the $location and marks invisible all descendants of $location.
Definition: Core/Repository/SiteAccessAware/LocationService.php:123
eZ\Publish\API\Repository\LanguageResolver
Resolve language settings for Repository layer.
Definition: Publish/API/Repository/LanguageResolver.php:15
eZ\Publish\API\Repository\LocationService
Definition: API/Repository/LocationService.php:21
eZ\Publish\Core\Repository\SiteAccessAware
Definition: Core/Repository/SiteAccessAware/ContentService.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.