Copied!

URLWildcardService

URLWildcardService.php : 22

URLAlias service.

Tags
Example

Examples/urlalias.php

Methods

publiccountAll()

URLWildcardService.php : 110

Counts URL Wildcards.

public countAll() : int

Return values

int

publiccreate()

URLWildcardService.php : 39

Creates a new url wildcard.

public create(string $sourceUrl, string $destinationUrl[, bool $forward = false ]) : UrlWildcard

Parameters

Name Type Default value Description
$sourceUrl string - -
$destinationUrl string - -
$forward bool false -

Return values

UrlWildcard

Tags
Throws
InvalidArgumentException

if the $sourceUrl pattern already exists

Throws
UnauthorizedException

if the user is not allowed to create url wildcards

Throws
ContentValidationException

if the number of "*" patterns in $sourceUrl and the number of {\d} placeholders in $destinationUrl doesn't match or if the placeholders aren't a valid number sequence({1}/{2}/{3}), starting with 1.

publicfindUrlWildcards()

URLWildcardService.php : 93
public findUrlWildcards(URLWildcardQuery $query) : SearchResult

Parameters

Name Type Default value Description
$query URLWildcardQuery - -

Return values

SearchResult

Tags
Throws
UnauthorizedException
Throws
InvalidArgumentException

publicload()

URLWildcardService.php : 77

Loads a url wild card.

public load(int $id) : UrlWildcard

Parameters

Name Type Default value Description
$id int - -

Return values

UrlWildcard

Tags
Throws
NotFoundException

if the url wild card was not found

publicloadAll()

URLWildcardService.php : 87

Loads all url wild card (paged).

public loadAll([int $offset = 0 ][, int $limit = -1 ]) : array<string|int, UrlWildcard>

Parameters

Name Type Default value Description
$offset int 0 -
$limit int -1 -

Return values

array<string|int, UrlWildcard>

publicremove()

URLWildcardService.php : 66

Removes an url wildcard.

public remove(UrlWildcard $urlWildcard) : void

Parameters

Name Type Default value Description
$urlWildcard UrlWildcard -

the url wildcard to remove

Tags
Throws
UnauthorizedException

if the user is not allowed to remove url wildcards

publictranslate()

URLWildcardService.php : 105

Translates an url to an existing uri resource based on the source/destination patterns of the url wildcard.

public translate(string $url) : URLWildcardTranslationResult

Parameters

Name Type Default value Description
$url string - -

Return values

URLWildcardTranslationResult

Tags
Throws
NotFoundException

if the url could not be translated

publicupdate()

URLWildcardService.php : 54

Update an url wildcard.

public update(URLWildcard $urlWildcard, URLWildcardUpdateStruct $updateStruct) : void

Parameters

Name Type Default value Description
$urlWildcard URLWildcard - -
$updateStruct URLWildcardUpdateStruct - -
Tags
Throws
UnauthorizedException

if the user is not allowed to update url wildcards

Throws
ContentValidationException

if the number of "*" patterns in $sourceUrl and the number of {\d} placeholders in $destinationUrl doesn't match or if the placeholders aren't a valid number sequence({1}/{2}/{3}), starting with 1.

Throws
BadStateException
Throws
InvalidArgumentException

if the $sourceUrl pattern already exists