3 namespace Drupal\Core\ParamConverter;
5 use Symfony\Component\Routing\RouteCollection;
8 * Provides an interface for a parameter converter manager.
10 interface ParamConverterManagerInterface {
13 * Registers a parameter converter with the manager.
15 * @param \Drupal\Core\ParamConverter\ParamConverterInterface $param_converter
16 * The added param converter instance.
18 * The parameter converter service id to register.
22 public function addConverter(ParamConverterInterface $param_converter, $id);
25 * Lazy-loads converter services.
28 * The service id of converter service to load.
30 * @return \Drupal\Core\ParamConverter\ParamConverterInterface
31 * The loaded converter service identified by the given service id.
33 * @throws \InvalidArgumentException
34 * If the given service id is not a registered converter.
36 public function getConverter($id);
39 * Saves a list of applicable converters to each route.
41 * @param \Symfony\Component\Routing\RouteCollection $routes
42 * A collection of routes to apply converters to.
44 public function setRouteParameterConverters(RouteCollection $routes);
47 * Invokes the registered converter for each defined parameter on a route.
49 * @param array $defaults
50 * The route defaults array.
53 * The modified defaults.
55 * @throws \Drupal\Core\ParamConverter\ParamNotConvertedException
56 * If one of the assigned converters returned NULL because the given
57 * variable could not be converted.
59 public function convert(array $defaults);