Class

eZ\Publish\Core\Repository\URLWildcardService

class URLWildcardService implements URLWildcardService

URLAlias service.

Methods

__construct(Repository $repository, Handler $urlWildcardHandler, array $settings = array())

Setups service with reference to repository object that created it & corresponding handler.

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 52
public __construct(Repository $repository, Handler $urlWildcardHandler, array $settings = array())

Setups service with reference to repository object that created it & corresponding handler.

Parameters

Repository $repository
Handler $urlWildcardHandler
array $settings

at line 76
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 numbers in {\d} placeholders in $destinationUrl does not match.

at line 140
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 167
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 182
public UrlWildcard[] loadAll(int $offset, int $limit = -1)

Loads all url wild card (paged).

Parameters

int $offset
int $limit

Return Value

UrlWildcard[]

at line 207
public URLWildcardTranslationResult translate(mixed $url)

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

Parameters

mixed $url

Return Value

URLWildcardTranslationResult

Exceptions

NotFoundException if the url could not be translated