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

Core/Repository/SiteAccessAware/URLAliasService.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\URLAliasService as URLAliasServiceInterface;
10 use eZ\Publish\API\Repository\Values\Content\Location;
11 use eZ\Publish\API\Repository\LanguageResolver;
12
16 class URLAliasService implements URLAliasServiceInterface
17 {
19 protected $service;
20
22 protected $languageResolver;
23
30 public function __construct(
31 URLAliasServiceInterface $service,
32 LanguageResolver $languageResolver
33 ) {
34 $this->service = $service;
35 $this->languageResolver = $languageResolver;
36 }
37
38 public function createUrlAlias(Location $location, $path, $languageCode, $forwarding = false, $alwaysAvailable = false)
39 {
40 return $this->service->createUrlAlias($location, $path, $languageCode, $forwarding, $alwaysAvailable);
41 }
42
43 public function createGlobalUrlAlias($resource, $path, $languageCode, $forwarding = false, $alwaysAvailable = false)
44 {
45 return $this->service->createGlobalUrlAlias($resource, $path, $languageCode, $forwarding, $alwaysAvailable);
46 }
47
48 public function listLocationAliases(
49 Location $location,
50 $custom = true,
51 $languageCode = null,
52 bool $showAllTranslations = null,
53 array $prioritizedLanguages = null
54 ) {
55 return $this->service->listLocationAliases(
56 $location,
57 $custom,
58 $languageCode,
59 $this->languageResolver->getShowAllTranslations($showAllTranslations),
60 $this->languageResolver->getPrioritizedLanguages($prioritizedLanguages)
61 );
62 }
63
64 public function listGlobalAliases($languageCode = null, $offset = 0, $limit = -1)
65 {
66 return $this->service->listGlobalAliases($languageCode, $offset, $limit);
67 }
68
69 public function removeAliases(array $aliasList)
70 {
71 return $this->service->removeAliases($aliasList);
72 }
73
74 public function lookup($url, $languageCode = null)
75 {
76 return $this->service->lookup($url, $languageCode);
77 }
78
79 public function reverseLookup(
80 Location $location,
81 $languageCode = null,
82 bool $showAllTranslations = null,
83 array $prioritizedLanguages = null
84 ) {
85 return $this->service->reverseLookup(
86 $location,
87 $languageCode,
88 $this->languageResolver->getShowAllTranslations($showAllTranslations),
89 $this->languageResolver->getPrioritizedLanguages($prioritizedLanguages)
90 );
91 }
92
93 public function load($id)
94 {
95 return $this->service->load($id);
96 }
97
98 public function refreshSystemUrlAliasesForLocation(Location $location): void
99 {
100 $this->service->refreshSystemUrlAliasesForLocation($location);
101 }
102
103 public function deleteCorruptedUrlAliases(): int
104 {
105 return $this->service->deleteCorruptedUrlAliases();
106 }
107 }
eZ\Publish\API\Repository\Values\Content\Location
Definition: API/Repository/Values/Content/Location.php:32
eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService
SiteAccess aware implementation of URLAliasService injecting languages where needed.
Definition: Core/Repository/SiteAccessAware/URLAliasService.php:17
eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\refreshSystemUrlAliasesForLocation
refreshSystemUrlAliasesForLocation(Location $location)
Refresh all system URL aliases for the given Location (and historize outdated if needed).
Definition: Core/Repository/SiteAccessAware/URLAliasService.php:98
eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\__construct
__construct(URLAliasServiceInterface $service, LanguageResolver $languageResolver)
Construct service object from aggregated service and LanguageResolver.
Definition: Core/Repository/SiteAccessAware/URLAliasService.php:30
eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\load
load($id)
Loads URL alias by given $id.
Definition: Core/Repository/SiteAccessAware/URLAliasService.php:93
eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\listLocationAliases
listLocationAliases(Location $location, $custom=true, $languageCode=null, bool $showAllTranslations=null, array $prioritizedLanguages=null)
Definition: Core/Repository/SiteAccessAware/URLAliasService.php:48
eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\listGlobalAliases
listGlobalAliases($languageCode=null, $offset=0, $limit=-1)
List global aliases.
Definition: Core/Repository/SiteAccessAware/URLAliasService.php:64
eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\deleteCorruptedUrlAliases
deleteCorruptedUrlAliases()
Delete global, system or custom URL alias pointing to non-existent Locations.
Definition: Core/Repository/SiteAccessAware/URLAliasService.php:103
eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\reverseLookup
reverseLookup(Location $location, $languageCode=null, bool $showAllTranslations=null, array $prioritizedLanguages=null)
Definition: Core/Repository/SiteAccessAware/URLAliasService.php:79
eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\$languageResolver
$languageResolver
Definition: Core/Repository/SiteAccessAware/URLAliasService.php:22
eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\$service
$service
Definition: Core/Repository/SiteAccessAware/URLAliasService.php:19
eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\lookup
lookup($url, $languageCode=null)
looks up the URLAlias for the given url.
Definition: Core/Repository/SiteAccessAware/URLAliasService.php:74
eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\createGlobalUrlAlias
createGlobalUrlAlias($resource, $path, $languageCode, $forwarding=false, $alwaysAvailable=false)
Create a user chosen $alias pointing to a resource in $languageCode.
Definition: Core/Repository/SiteAccessAware/URLAliasService.php:43
eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\removeAliases
removeAliases(array $aliasList)
Removes urls aliases.
Definition: Core/Repository/SiteAccessAware/URLAliasService.php:69
eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\createUrlAlias
createUrlAlias(Location $location, $path, $languageCode, $forwarding=false, $alwaysAvailable=false)
Create a user chosen $alias pointing to $location in $languageCode.
Definition: Core/Repository/SiteAccessAware/URLAliasService.php:38
eZ\Publish\API\Repository\LanguageResolver
Resolve language settings for Repository layer.
Definition: Publish/API/Repository/LanguageResolver.php:15
eZ\Publish\API\Repository\URLAliasService
Definition: API/Repository/URLAliasService.php:17
eZ\Publish\Core\Repository\SiteAccessAware
Definition: Core/Repository/SiteAccessAware/ContentService.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.