interface ParamConverterManagerInterface (View source)

Provides an interface for a parameter converter manager.

Methods

$this
addConverter(ParamConverterInterface $param_converter, string $id)

Registers a parameter converter with the manager.

getConverter(string $id)

Lazy-loads converter services.

setRouteParameterConverters(RouteCollection $routes)

Saves a list of applicable converters to each route.

array
convert(array $defaults)

Invokes the registered converter for each defined parameter on a route.

Details

$this addConverter(ParamConverterInterface $param_converter, string $id)

Registers a parameter converter with the manager.

Parameters

ParamConverterInterface $param_converter

The added param converter instance.

string $id

The parameter converter service id to register.

Return Value

$this

ParamConverterInterface getConverter(string $id)

Lazy-loads converter services.

Parameters

string $id

The service id of converter service to load.

Return Value

ParamConverterInterface

The loaded converter service identified by the given service id.

Exceptions

InvalidArgumentException

setRouteParameterConverters(RouteCollection $routes)

Saves a list of applicable converters to each route.

Parameters

RouteCollection $routes

A collection of routes to apply converters to.

array convert(array $defaults)

Invokes the registered converter for each defined parameter on a route.

Parameters

array $defaults

The route defaults array.

Return Value

array

The modified defaults.

Exceptions

ParamNotConvertedException