PHP Class eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\URIElement

Inheritance: implements eZ\Publish\Core\MVC\Symfony\SiteAccess\VersatileMatcher, implements eZ\Publish\Core\MVC\Symfony\SiteAccess\URILexer
Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Public Methods

Method Description
__construct ( integer | array $elementNumber ) Constructor.
__sleep ( )
analyseLink ( string $linkUri ) : string Analyses $linkUri when generating a link to a route, in order to have the siteaccess part back in the URI.
analyseURI ( string $uri ) : string Analyses $uri and removes the siteaccess part, if needed.
getName ( )
getRequest ( ) : SimplifiedRequest
match ( ) : string | false Returns matching Siteaccess.
reverseMatch ( string $siteAccessName ) : URIElement | null Returns matcher object corresponding to $siteAccessName or null if non applicable.
setRequest ( SimplifiedRequest $request ) Injects the request object to match against.

Protected Methods

Method Description
getURIElements ( ) : array Returns URI elements as an array.

Method Details

__construct() public method

Constructor.
public __construct ( integer | array $elementNumber )
$elementNumber integer | array Number of elements to take into account.

__sleep() public method

public __sleep ( )

analyseURI() public method

Analyses $uri and removes the siteaccess part, if needed.
public analyseURI ( string $uri ) : string
$uri string The original URI
return string The modified URI

getName() public method

public getName ( )

getRequest() public method

public getRequest ( ) : SimplifiedRequest
return eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest

getURIElements() protected method

Returns URI elements as an array.
protected getURIElements ( ) : array
return array

match() public method

Returns matching Siteaccess.
public match ( ) : string | false
return string | false Siteaccess matched or false.

reverseMatch() public method

Limitation: If the element number is > 1, we cannot predict how URI segments are expected to be built. So we expect "_" will be reversed to "/" e.g. foo_bar => foo/bar with elementNumber == 2 Hence if number of elements is different than the element number, we report as non matched.
public reverseMatch ( string $siteAccessName ) : URIElement | null
$siteAccessName string
return URIElement | null

setRequest() public method

Injects the request object to match against.
public setRequest ( SimplifiedRequest $request )
$request eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest