1 | <?php |
||
26 | final class TenantAwareRouteToIdTransformer implements DataTransformerInterface |
||
27 | { |
||
28 | /** |
||
29 | * @var TenantContextInterface |
||
30 | */ |
||
31 | private $tenantContext; |
||
32 | |||
33 | /** |
||
34 | * @var RouteRepositoryInterface |
||
35 | */ |
||
36 | private $routeRepository; |
||
37 | |||
38 | /** |
||
39 | * TenantAwareRouteToIdTransformer constructor. |
||
40 | * |
||
41 | * @param TenantContextInterface $tenantContext |
||
42 | * @param RouteRepositoryInterface $routeRepository |
||
43 | */ |
||
44 | public function __construct(TenantContextInterface $tenantContext, RouteRepositoryInterface $routeRepository) |
||
49 | |||
50 | /** |
||
51 | * Transforms an object (route) to a string (id). |
||
52 | * |
||
53 | * @param RouteInterface|string $route |
||
54 | * |
||
55 | * @return string |
||
56 | * |
||
57 | * @throws TransformationFailedException if object (route) is of wrong type |
||
58 | */ |
||
59 | public function transform($route) |
||
71 | |||
72 | /** |
||
73 | * Transforms an id to an object (route). |
||
74 | * |
||
75 | * @param string $routeId |
||
76 | * |
||
77 | * @return RouteInterface |
||
78 | * |
||
79 | * @throws TransformationFailedException if object (route) is not found |
||
80 | */ |
||
81 | public function reverseTransform($routeId) |
||
105 | } |
||
106 |