blob: 0f91f64872025a9786b66dbcd0ab4953e3dbed4e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
<?php
namespace Drupal\Core\ParamConverter;
use Symfony\Component\Routing\RouteCollection;
/**
* Provides an interface for a parameter converter manager.
*/
interface ParamConverterManagerInterface {
/**
* Registers a parameter converter with the manager.
*
* @param \Drupal\Core\ParamConverter\ParamConverterInterface $param_converter
* The added param converter instance.
* @param string $id
* The parameter converter service id to register.
*
* @return $this
*/
public function addConverter(ParamConverterInterface $param_converter, $id);
/**
* Lazy-loads converter services.
*
* @param string $id
* The service id of converter service to load.
*
* @return \Drupal\Core\ParamConverter\ParamConverterInterface
* The loaded converter service identified by the given service id.
*
* @throws \InvalidArgumentException
* If the given service id is not a registered converter.
*/
public function getConverter($id);
/**
* Saves a list of applicable converters to each route.
*
* @param \Symfony\Component\Routing\RouteCollection $routes
* A collection of routes to apply converters to.
*/
public function setRouteParameterConverters(RouteCollection $routes);
/**
* Invokes the registered converter for each defined parameter on a route.
*
* @param array $defaults
* The route defaults array.
*
* @return array
* The modified defaults.
*
* @throws \Drupal\Core\ParamConverter\ParamNotConvertedException
* If one of the assigned converters returned NULL because the given
* variable could not be converted.
*/
public function convert(array $defaults);
}
|