AbstractEnhancer implements EnhancerInterface
AbstractYes
Abstract Enhancer, useful for custom enhancers
Table of Contents
Interfaces
- EnhancerInterface
- Base interface for enhancers, which can be decorators for adding parameters, or routing enhancers which adds variants to a page.
Properties
- $aspects : array<string|int, AspectInterface>
- $variableProcessor : VariableProcessor|null
Methods
- getAspects() : array<string|int, AspectInterface>
- setAspects() : void
- applyRequirements() : mixed
- applyRouteAspects() : mixed
- defineValuesByAspect() : array<string|int, mixed>
- Define items having an aspect definition in case they are not defined with a given $targetValue in target $targetValue array.
- filterValuesByPathVariables() : array<string|int, mixed>
- Only keeps values that actually have been used as variables in route path.
- getVariableProcessor() : VariableProcessor
- modifyRoutePath() : string
- Modify the route path to add the variable names with the aspects, e.g.
- overrideValuesByAspect() : array<string|int, mixed>
- Overrides items having an aspect definition with a given $overrideValue in target $targetValue array.
- resolveType() : string
- Retrieves type from processed route and modifies remaining query parameters.
Properties
$aspects
protected
array<string|int, AspectInterface>
$aspects
= []
$variableProcessor
protected
VariableProcessor|null
$variableProcessor
Methods
getAspects()
public
getAspects() : array<string|int, AspectInterface>
Return values
array<string|int, AspectInterface>setAspects()
public
setAspects(array<string|int, mixed> $aspects) : void
Parameters
- $aspects : array<string|int, mixed>
applyRequirements()
protected
applyRequirements(Route $route, array<string|int, mixed> $requirements[, string|null $namespace = null ]) : mixed
Parameters
- $route : Route
- $requirements : array<string|int, mixed>
- $namespace : string|null = null
applyRouteAspects()
protected
applyRouteAspects(Route $route, array<string|int, AspectInterface> $aspects[, string|null $namespace = null ]) : mixed
Parameters
- $route : Route
- $aspects : array<string|int, AspectInterface>
- $namespace : string|null = null
defineValuesByAspect()
Define items having an aspect definition in case they are not defined with a given $targetValue in target $targetValue array.
protected
defineValuesByAspect(Route $route, array<string|int, mixed> $values, string $targetValue) : array<string|int, mixed>
Parameters
- $route : Route
- $values : array<string|int, mixed>
- $targetValue : string
Return values
array<string|int, mixed>filterValuesByPathVariables()
Only keeps values that actually have been used as variables in route path.
protected
filterValuesByPathVariables(Route $route, array<string|int, mixed> $values) : array<string|int, mixed>
- routePath: '/list/{page}' ('page' used as variable in route path)
- values: ['entity' => 'entity...', 'page' => 'page...', 'other' => 'other...']
- result: ['page' => 'page...']
Parameters
- $route : Route
- $values : array<string|int, mixed>
Return values
array<string|int, mixed>getVariableProcessor()
protected
getVariableProcessor() : VariableProcessor
Return values
VariableProcessormodifyRoutePath()
Modify the route path to add the variable names with the aspects, e.g.
protected
modifyRoutePath(string $routePath) : string
-
/{locale_modifier}/{product_title}
->/products/{product_title}
-
/{!locale_modifier}/{product_title}
->/products/{product_title}
Parameters
- $routePath : string
Return values
stringoverrideValuesByAspect()
Overrides items having an aspect definition with a given $overrideValue in target $targetValue array.
protected
overrideValuesByAspect(Route $route, array<string|int, mixed> $values, string $targetValue) : array<string|int, mixed>
Parameters
- $route : Route
- $values : array<string|int, mixed>
- $targetValue : string
Return values
array<string|int, mixed>resolveType()
Retrieves type from processed route and modifies remaining query parameters.
protected
resolveType(Route $route, array<string|int, mixed> &$remainingQueryParameters) : string
Parameters
- $route : Route
- $remainingQueryParameters : array<string|int, mixed>
-
reference to remaining query parameters