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  : AspectInterface[]
$variableProcessor  : VariableProcessor|null

Methods

getAspects()  : AspectInterface[]
setAspects()  : void
applyRequirements()  : mixed
applyRouteAspects()  : mixed
defineValuesByAspect()  : array
Define items having an aspect definition in case they are not defined with a given $targetValue in target $targetValue array.
filterValuesByPathVariables()  : array
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
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

Methods

setAspects()

public setAspects(array $aspects) : void
Parameters
$aspects : array

applyRequirements()

protected applyRequirements(Route $route, array $requirements[, string|null $namespace = null ]) : mixed
Parameters
$route : Route
$requirements : array
$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 $values, string $targetValue) : array
Parameters
$route : Route
$values : array
$targetValue : string
Return values
array

filterValuesByPathVariables()

Only keeps values that actually have been used as variables in route path.

protected filterValuesByPathVariables(Route $route, array $values) : array
  • 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
Return values
array

modifyRoutePath()

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
string

overrideValuesByAspect()

Overrides items having an aspect definition with a given $overrideValue in target $targetValue array.

protected overrideValuesByAspect(Route $route, array $values, string $targetValue) : array
Parameters
$route : Route
$values : array
$targetValue : string
Return values
array

resolveType()

Retrieves type from processed route and modifies remaining query parameters.

protected resolveType(Route $route, array &$remainingQueryParameters) : string
Parameters
$route : Route
$remainingQueryParameters : array

reference to remaining query parameters

Return values
string
On this page

Search results