1 | <?php |
||
23 | final class ParentRouteToIdTransformer implements DataTransformerInterface |
||
24 | { |
||
25 | /** |
||
26 | * @var RouteProviderInterface |
||
27 | */ |
||
28 | private $routeProvider; |
||
29 | |||
30 | /** |
||
31 | * RouteToIdTransformer constructor. |
||
32 | * |
||
33 | * @param RouteProviderInterface $routeProvider |
||
34 | */ |
||
35 | 16 | public function __construct(RouteProviderInterface $routeProvider) |
|
39 | |||
40 | /** |
||
41 | * Transforms an object (route) to a string (id). |
||
42 | * |
||
43 | * @param RouteInterface|string $route |
||
44 | * |
||
45 | * @return string |
||
46 | * |
||
47 | * @throws TransformationFailedException if object (route) is of wrong type |
||
48 | */ |
||
49 | 16 | public function transform($route) |
|
66 | |||
67 | /** |
||
68 | * Transforms an id to an object (route). |
||
69 | * |
||
70 | * @param string $routeId |
||
71 | * |
||
72 | * @return RouteInterface |
||
73 | * |
||
74 | * @throws TransformationFailedException if object (route) is not found |
||
75 | */ |
||
76 | 16 | public function reverseTransform($routeId) |
|
89 | } |
||
90 |