Class

eZ\Publish\Core\SignalSlot\URLWildcardService

class URLWildcardService implements URLWildcardService

URLWildcardService class.

Methods

__construct(URLWildcardService $service, SignalDispatcher $signalDispatcher)

Constructor.

UrlWildcard create(string $sourceUrl, string $destinationUrl, bool $forward = false)

Creates a new url wildcard.

remove(URLWildcard $urlWildcard)

removes an url wildcard.

UrlWildcard load(mixed $id)

Loads a url wild card.

UrlWildcard[] loadAll(int $offset, int $limit = -1)

Loads all url wild card (paged).

URLWildcardTranslationResult translate(mixed $url)

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

Details

at line 45
public __construct(URLWildcardService $service, SignalDispatcher $signalDispatcher)

Constructor.

Construct service object from aggregated service and signal dispatcher

Parameters

URLWildcardService $service
SignalDispatcher $signalDispatcher

at line 66
public UrlWildcard create(string $sourceUrl, string $destinationUrl, bool $forward = false)

Creates a new url wildcard.

Parameters

string $sourceUrl
string $destinationUrl
bool $forward

Return Value

UrlWildcard

Exceptions

InvalidArgumentException if the $sourceUrl pattern already exists
UnauthorizedException if the user is not allowed to create url wildcards
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.

at line 87
public remove(URLWildcard $urlWildcard)

removes an url wildcard.

Parameters

URLWildcard $urlWildcard the url wildcard to remove

Exceptions

UnauthorizedException if the user is not allowed to remove url wildcards

at line 110
public UrlWildcard load(mixed $id)

Loads a url wild card.

Parameters

mixed $id

Return Value

UrlWildcard

Exceptions

NotFoundException if the url wild card was not found

at line 123
public UrlWildcard[] loadAll(int $offset, int $limit = -1)

Loads all url wild card (paged).

Parameters

int $offset
int $limit

Return Value

UrlWildcard[]

at line 141
public URLWildcardTranslationResult translate(mixed $url)

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

If the resulting url is an alias it will be translated to the system uri.

This method runs also configured url translations and filter

Parameters

mixed $url

Return Value

URLWildcardTranslationResult

Exceptions

NotFoundException if the url could not be translated