Skip to content

Commit 062cc64

Browse files
committed
IBX-11423: added optional parameter $showAllTranslations to URLAliasService::load
1 parent 37e312c commit 062cc64

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/contracts/Repository/Decorator/URLAliasServiceDecorator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ public function reverseLookup(
9292
);
9393
}
9494

95-
public function load(string $id): URLAlias
95+
public function load(string $id, ?bool $showAllTranslations = null): URLAlias
9696
{
97-
return $this->innerService->load($id);
97+
return $this->innerService->load($id, $showAllTranslations);
9898
}
9999

100100
public function refreshSystemUrlAliasesForLocation(Location $location): void

src/contracts/Repository/URLAliasService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,11 @@ public function reverseLookup(
156156
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
157157
*
158158
* @param string $id
159+
* @param bool|null $showAllTranslations If enabled will include all alias as if they where always available.
159160
*
160161
* @return \Ibexa\Contracts\Core\Repository\Values\Content\URLAlias
161162
*/
162-
public function load(string $id): URLAlias;
163+
public function load(string $id, ?bool $showAllTranslations = null): URLAlias;
163164

164165
/**
165166
* Refresh all system URL aliases for the given Location (and historize outdated if needed).

src/lib/Repository/SiteAccessAware/URLAliasService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ public function reverseLookup(
103103
);
104104
}
105105

106-
public function load(string $id): URLAlias
106+
public function load(string $id, ?bool $showAllTranslations = null): URLAlias
107107
{
108-
return $this->service->load($id);
108+
return $this->service->load($id, $showAllTranslations);
109109
}
110110

111111
public function refreshSystemUrlAliasesForLocation(Location $location): void

src/lib/Repository/URLAliasService.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,16 +721,17 @@ public function reverseLookup(
721721
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
722722
*
723723
* @param string $id
724+
* @param bool|null $showAllTranslations If enabled will include all alias as if they where always available.
724725
*
725726
* @return \Ibexa\Contracts\Core\Repository\Values\Content\URLAlias
726727
*/
727-
public function load(string $id): URLAlias
728+
public function load(string $id, ?bool $showAllTranslations = null): URLAlias
728729
{
729730
$spiUrlAlias = $this->urlAliasHandler->loadUrlAlias($id);
730731
$path = $this->extractPath(
731732
$spiUrlAlias,
732733
null,
733-
$this->languageResolver->getShowAllTranslations(),
734+
$this->languageResolver->getShowAllTranslations($showAllTranslations),
734735
$this->languageResolver->getPrioritizedLanguages()
735736
);
736737

0 commit comments

Comments
 (0)