|
25 | 25 | use ApiPlatform\Core\DataProvider\CollectionDataProviderInterface;
|
26 | 26 | use ApiPlatform\Core\DataProvider\ItemDataProviderInterface;
|
27 | 27 | use ApiPlatform\Core\DataProvider\SubresourceDataProviderInterface;
|
| 28 | +use ApiPlatform\Core\DataTransformer\DataTransformerInterface; |
28 | 29 | use ApiPlatform\Core\Exception\RuntimeException;
|
29 | 30 | use Doctrine\Common\Annotations\Annotation;
|
30 | 31 | use Doctrine\ORM\Version;
|
@@ -150,6 +151,7 @@ public function load(array $configs, ContainerBuilder $container)
|
150 | 151 | $this->registerMercureConfiguration($container, $config, $loader, $useDoctrine);
|
151 | 152 | $this->registerMessengerConfiguration($config, $loader);
|
152 | 153 | $this->registerElasticsearchConfiguration($container, $config, $loader);
|
| 154 | + $this->registerDataTransformerConfiguration($container); |
153 | 155 | }
|
154 | 156 |
|
155 | 157 | /**
|
@@ -603,4 +605,10 @@ private function registerElasticsearchConfiguration(ContainerBuilder $container,
|
603 | 605 | $container->setParameter('api_platform.elasticsearch.hosts', $config['elasticsearch']['hosts']);
|
604 | 606 | $container->setParameter('api_platform.elasticsearch.mapping', $config['elasticsearch']['mapping']);
|
605 | 607 | }
|
| 608 | + |
| 609 | + private function registerDataTransformerConfiguration(ContainerBuilder $container) |
| 610 | + { |
| 611 | + $container->registerForAutoconfiguration(DataTransformerInterface::class) |
| 612 | + ->addTag('api_platform.data_transformer'); |
| 613 | + } |
606 | 614 | }
|
0 commit comments