Copied!

URLAliasServiceDecorator

URLAliasServiceDecorator.php : 15
Implements URLAliasService

Properties

protected $innerService

URLAliasServiceDecorator.php : 18
protected URLAliasService $innerService

Methods

public__construct()

URLAliasServiceDecorator.php : 20
public __construct(URLAliasService $innerService)

Parameters

Name Type Default value Description
$innerService URLAliasService - -

publiccreateGlobalUrlAlias()

URLAliasServiceDecorator.php : 35

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

public createGlobalUrlAlias(string $resource, string $path, string $languageCode[, bool $forwarding = false ][, bool $alwaysAvailable = false ]) : URLAlias

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.

Parameters

Name Type Default value Description
$resource string - -
$path string - -
$languageCode string - -
$forwarding bool false -
$alwaysAvailable bool false -

Return values

URLAlias

publiccreateUrlAlias()

URLAliasServiceDecorator.php : 25

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

public createUrlAlias(Location $location, string $path, string $languageCode[, bool $forwarding = false ][, bool $alwaysAvailable = false ]) : URLAlias

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

Name Type Default value Description
$location Location - -
$path string - -
$languageCode string -

the languageCode for which this alias is valid

$forwarding bool false

if true a redirect is performed

$alwaysAvailable bool false -

Return values

URLAlias

publicdeleteCorruptedUrlAliases()

URLAliasServiceDecorator.php : 105

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

public deleteCorruptedUrlAliases() : int

Return values

int

Number of deleted URL aliases

publiclistGlobalAliases()

URLAliasServiceDecorator.php : 61

List global aliases.

public listGlobalAliases([string|null $languageCode = null ][, int $offset = 0 ][, int $limit = -1 ]) : array<string|int, URLAlias>

Parameters

Name Type Default value Description
$languageCode string|null null

filters those which are valid for the given language

$offset int 0 -
$limit int -1 -

Return values

array<string|int, URLAlias>

publiclistLocationAliases()

URLAliasServiceDecorator.php : 45

List of url aliases pointing to $location, sorted by language priority.

public listLocationAliases(Location $location[, bool $custom = true ][, string|null $languageCode = null ][, bool|null $showAllTranslations = null ][, array<string|int, mixed>|null $prioritizedLanguages = null ]) : array<string|int, URLAlias>

Parameters

Name Type Default value Description
$location Location - -
$custom bool true

if true the user generated aliases are listed otherwise the autogenerated

$languageCode string|null null

filters those which are valid for the given language

$showAllTranslations bool|null null

If enabled will include all alias as if they where always available.

$prioritizedLanguages array<string|int, mixed>|null null

If set used as prioritized language codes, returning first match.

Return values

array<string|int, URLAlias>

publicload()

URLAliasServiceDecorator.php : 95

Loads URL alias by given $id.

public load(string $id) : URLAlias

Parameters

Name Type Default value Description
$id string - -

Return values

URLAlias

publiclookup()

URLAliasServiceDecorator.php : 74

looks up the URLAlias for the given url.

public lookup(string $url[, string|null $languageCode = null ]) : URLAlias

Parameters

Name Type Default value Description
$url string - -
$languageCode string|null null -

Return values

URLAlias

publicrefreshSystemUrlAliasesForLocation()

URLAliasServiceDecorator.php : 100

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

public refreshSystemUrlAliasesForLocation(Location $location) : void

Parameters

Name Type Default value Description
$location Location - -

publicremoveAliases()

URLAliasServiceDecorator.php : 69

Removes urls aliases.

public removeAliases(array<string|int, mixed> $aliasList) : void

This method does not remove autogenerated aliases for locations.

Parameters

Name Type Default value Description
$aliasList array<string|int, mixed> - -

publicreverseLookup()

URLAliasServiceDecorator.php : 81

Returns the URL alias for the given location in the given language.

public reverseLookup(Location $location[, string|null $languageCode = null ][, bool|null $showAllTranslations = null ][, array<string|int, mixed>|null $prioritizedLanguages = null ]) : URLAlias

If $languageCode is null the method returns the url alias in the most prioritized language.

Parameters

Name Type Default value Description
$location Location - -
$languageCode string|null null

filters those which are valid for the given language

$showAllTranslations bool|null null

If enabled will include all alias as if they where always available.

$prioritizedLanguages array<string|int, mixed>|null null

If set used as prioritized language codes, returning first match.

Return values

URLAlias