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

Public Member Functions | Protected Attributes | List of all members
eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService Class Reference

SiteAccess aware implementation of URLAliasService injecting languages where needed. More...

Inheritance diagram for eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService:

## Public Member Functions
| __construct (URLAliasServiceInterface $service, LanguageResolver $languageResolver)
| Construct service object from aggregated service and LanguageResolver. More...
| createUrlAlias (Location $location, $path, $languageCode, $forwarding=false, $alwaysAvailable=false)
| Create a user chosen $alias pointing to $location in $languageCode. More...
| createGlobalUrlAlias ($resource, $path, $languageCode, $forwarding=false, $alwaysAvailable=false)
| Create a user chosen $alias pointing to a resource in $languageCode. More...
| listLocationAliases (Location $location, $custom=true, $languageCode=null, bool $showAllTranslations=null, array $prioritizedLanguages=null)
| listGlobalAliases ($languageCode=null, $offset=0, $limit=-1)
| List global aliases. More...
| removeAliases (array $aliasList)
| Removes urls aliases. More...
| lookup ($url, $languageCode=null)
| looks up the URLAlias for the given url. More...
| reverseLookup (Location $location, $languageCode=null, bool $showAllTranslations=null, array $prioritizedLanguages=null)
| load ($id)
| Loads URL alias by given $id. More...
| refreshSystemUrlAliasesForLocation (Location $location)
| Refresh all system URL aliases for the given Location (and historize outdated if needed). More...
| deleteCorruptedUrlAliases ()
| Delete global, system or custom URL alias pointing to non-existent Locations. More...
Public Member Functions inherited from eZ\Publish\API\Repository\URLAliasService
| listLocationAliases (Location $location, $custom=true, $languageCode=null)
| List of url aliases pointing to $location, sorted by language priority. More...
| reverseLookup (Location $location, $languageCode=null)
| Returns the URL alias for the given location in the given language. More...

## Protected Attributes
| $service
| $languageResolver

## Detailed Description

SiteAccess aware implementation of URLAliasService injecting languages where needed.

Definition at line 16 of file Core/Repository/SiteAccessAware/URLAliasService.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService::__construct | ( | URLAliasServiceInterface | $service,
|  | LanguageResolver | $languageResolver
| ) |  |

Construct service object from aggregated service and LanguageResolver.

Parameters

  \eZ\Publish\API\Repository\URLAliasService | $service |
  \eZ\Publish\API\Repository\LanguageResolver | $languageResolver |

Definition at line 30 of file Core/Repository/SiteAccessAware/URLAliasService.php.

References eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\$languageResolver, and eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\$service.

## Member Function Documentation

## ◆ createGlobalUrlAlias()

eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService::createGlobalUrlAlias | ( |  | $resource,
|  |  | $path,
|  |  | $languageCode,
|  |  | $forwarding = `false`,
|  |  | $alwaysAvailable = `false`
| ) |  |

Create a user chosen $alias pointing to a resource in $languageCode.

This method does not handle location resources - if a user enters a location target the createCustomUrlAlias method has to be used. This method runs URL filters and and transformers before storing them. Hence the path returned in the URLAlias Value may differ from the given.

$alwaysAvailable makes the alias available in all languages.

Exceptions

Implements eZ\Publish\API\Repository\URLAliasService.

Definition at line 43 of file Core/Repository/SiteAccessAware/URLAliasService.php.

## ◆ createUrlAlias()

eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService::createUrlAlias | ( | Location | $location,
|  |  | $path,
|  |  | $languageCode,
|  |  | $forwarding = `false`,
|  |  | $alwaysAvailable = `false`
| ) |  |

Create a user chosen $alias pointing to $location in $languageCode.

This method runs URL filters and transformers before storing them. Hence the path returned in the URLAlias Value may differ from the given. $alwaysAvailable makes the alias available in all languages.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Location | $location |
  string | $path |
  string | $languageCode | the languageCode for which this alias is valid
  bool | $forwarding | if true a redirect is performed
  bool | $alwaysAvailable |

Exceptions

Implements eZ\Publish\API\Repository\URLAliasService.

Definition at line 38 of file Core/Repository/SiteAccessAware/URLAliasService.php.

## ◆ deleteCorruptedUrlAliases()

eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService::deleteCorruptedUrlAliases | ( |  | ) |

Delete global, system or custom URL alias pointing to non-existent Locations.

Returns
  int Number of deleted URL aliases

Implements eZ\Publish\API\Repository\URLAliasService.

Definition at line 103 of file Core/Repository/SiteAccessAware/URLAliasService.php.

## ◆ listGlobalAliases()

eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService::listGlobalAliases | ( |  | $languageCode = `null`,
|  |  | $offset = `0`,
|  |  | $limit = `-1`
| ) |  |

List global aliases.

Parameters

  string | $languageCode | filters those which are valid for the given language
  int | $offset |
  int | $limit |

Returns
  \eZ\Publish\API\Repository\Values\Content\URLAlias[]

Implements eZ\Publish\API\Repository\URLAliasService.

Definition at line 64 of file Core/Repository/SiteAccessAware/URLAliasService.php.

## ◆ listLocationAliases()

eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService::listLocationAliases | ( | Location | $location,
|  |  | $custom = `true`,
|  |  | $languageCode = `null`,
|  | bool | $showAllTranslations = `null`,
|  | array | $prioritizedLanguages = `null`
| ) |  |

Definition at line 48 of file Core/Repository/SiteAccessAware/URLAliasService.php.

## ◆ load()

eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService::load | ( |  | $id | ) |

Loads URL alias by given $id.

Exceptions

Implements eZ\Publish\API\Repository\URLAliasService.

Definition at line 93 of file Core/Repository/SiteAccessAware/URLAliasService.php.

## ◆ lookup()

eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService::lookup | ( |  | $url,
|  |  | $languageCode = `null`
| ) |  |

looks up the URLAlias for the given url.

Parameters

  string | $url |
  string | $languageCode |

Exceptions

Implements eZ\Publish\API\Repository\URLAliasService.

Definition at line 74 of file Core/Repository/SiteAccessAware/URLAliasService.php.

## ◆ refreshSystemUrlAliasesForLocation()

eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService::refreshSystemUrlAliasesForLocation | ( | Location | $location | ) |

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

Parameters

  \eZ\Publish\API\Repository\Values\Content\Location | $location |

Implements eZ\Publish\API\Repository\URLAliasService.

Definition at line 98 of file Core/Repository/SiteAccessAware/URLAliasService.php.

## ◆ removeAliases()

eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService::removeAliases | ( | array | $aliasList | ) |

Removes urls aliases.

This method does not remove autogenerated aliases for locations.

Exceptions

Implements eZ\Publish\API\Repository\URLAliasService.

Definition at line 69 of file Core/Repository/SiteAccessAware/URLAliasService.php.

## ◆ reverseLookup()

eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService::reverseLookup | ( | Location | $location,
|  |  | $languageCode = `null`,
|  | bool | $showAllTranslations = `null`,
|  | array | $prioritizedLanguages = `null`
| ) |  |

Definition at line 79 of file Core/Repository/SiteAccessAware/URLAliasService.php.

## Member Data Documentation

## ◆ $languageResolver

eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService::$languageResolver
| protected

Definition at line 22 of file Core/Repository/SiteAccessAware/URLAliasService.php.

Referenced by eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\__construct().

## ◆ $service

eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService::$service
| protected

Definition at line 19 of file Core/Repository/SiteAccessAware/URLAliasService.php.

Referenced by eZ\Publish\Core\Repository\SiteAccessAware\URLAliasService\__construct().

The documentation for this class was generated from the following file:

- Core/Repository/SiteAccessAware/URLAliasService.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.