PHP Class eZ\Publish\Core\REST\Common\RequestParser\Pattern

Handles 2 types of patterns to be used in an URL: - {foo} matches anything but a slash and is used to match the typical URL variable (e.g. an ID) - {&foo} matches the slash, too, and is used to match only those URL variables, which may have a slash
Inheritance: implements eZ\Publish\Core\REST\Common\RequestParser
Afficher le fichier Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Свойство Type Description
$compileCache array Cache for compiled expressions.
$map array Map of URL types to their URL patterns.

Méthodes publiques

Méthode Description
__construct ( array $map = [] ) Construct from optional initial map.
addPattern ( string $type, string $pattern ) Adds a pattern for a type.
generate ( string $type, array $values = [] ) : string Generate a URL of the given type from the specified values.
parse ( string $url ) : array Parse URL and return the IDs contained in the URL.
parseHref ( $href, $attribute )

Méthodes protégées

Méthode Description
compile ( string $pattern ) : string Compiles a given pattern to a PCRE regular expression.

Method Details

__construct() public méthode

Construct from optional initial map.
public __construct ( array $map = [] )
$map array

addPattern() public méthode

Adds a pattern for a type.
public addPattern ( string $type, string $pattern )
$type string
$pattern string

compile() protected méthode

Compiles a given pattern to a PCRE regular expression.
protected compile ( string $pattern ) : string
$pattern string
Résultat string

generate() public méthode

Generate a URL of the given type from the specified values.
public generate ( string $type, array $values = [] ) : string
$type string
$values array
Résultat string

parse() public méthode

Parse URL and return the IDs contained in the URL.
public parse ( string $url ) : array
$url string
Résultat array

parseHref() public méthode

public parseHref ( $href, $attribute )

Property Details

$compileCache protected_oe property

Cache for compiled expressions.
protected array $compileCache
Résultat array

$map protected_oe property

Map of URL types to their URL patterns.
protected array $map
Résultat array