ParamConverterManager
in package
Managers converters.
Tags
Table of Contents
- $converters : array<string|int, mixed>
- $namedConverters : array<string|int, mixed>
- add() : mixed
- Adds a parameter converter.
- all() : array<string|int, mixed>
- Returns all registered param converters.
- apply() : mixed
- Applies all converters to the passed configurations and stops when a converter is applied it will move on to the next configuration and so on.
- applyConverter() : mixed
- Applies converter on request based on the given configuration.
Properties
$converters
private
array<string|int, mixed>
$converters
= []
$namedConverters
private
array<string|int, mixed>
$namedConverters
= []
Methods
add()
Adds a parameter converter.
public
add(ParamConverterInterface $converter, int $priority[, string $name = null ]) : mixed
Converters match either explicitly via $name or by iteration over all converters with a $priority. If you pass a $priority = null then the added converter will not be part of the iteration chain and can only be invoked explicitly.
Parameters
- $converter : ParamConverterInterface
- $priority : int
-
the priority (between -10 and 10)
- $name : string = null
-
name of the converter
Return values
mixed —all()
Returns all registered param converters.
public
all() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of param converters
apply()
Applies all converters to the passed configurations and stops when a converter is applied it will move on to the next configuration and so on.
public
apply(Request $request, array<string|int, mixed>|object $configurations) : mixed
Parameters
- $request : Request
- $configurations : array<string|int, mixed>|object
Return values
mixed —applyConverter()
Applies converter on request based on the given configuration.
private
applyConverter(Request $request, ParamConverter $configuration) : mixed
Parameters
- $request : Request
- $configuration : ParamConverter