From 7b8bd94c30ceecdefd92907038e0141b3cd7423d Mon Sep 17 00:00:00 2001 From: Maxime Veber Date: Sat, 15 Jun 2024 01:44:54 +0200 Subject: [PATCH 1/2] :sparkles: Allow to override the data mapper of the api type With this feature you can now override the data_mapper easily! --- src/DependencyInjection/MelodiiaExtension.php | 2 ++ src/Resources/config/form.yaml | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 src/Resources/config/form.yaml diff --git a/src/DependencyInjection/MelodiiaExtension.php b/src/DependencyInjection/MelodiiaExtension.php index faeecb5..c2aa6e6 100644 --- a/src/DependencyInjection/MelodiiaExtension.php +++ b/src/DependencyInjection/MelodiiaExtension.php @@ -42,6 +42,8 @@ public function load(array $configs, ContainerBuilder $container) if ($container->hasAlias('melodiia.data_provider')) { $loader->load('crud.yaml'); } + + $loader->load('form.yaml'); } if (class_exists(Environment::class)) { diff --git a/src/Resources/config/form.yaml b/src/Resources/config/form.yaml new file mode 100644 index 0000000..2dddc6d --- /dev/null +++ b/src/Resources/config/form.yaml @@ -0,0 +1,9 @@ +services: + melodiia.form.data_mapper: + class: SwagIndustries\Melodiia\Form\DomainObjectsDataMapper + + SwagIndustries\Melodiia\Form\Type\ApiType: + arguments: + $dataMapper: '@melodiia.form.data_mapper' + tags: + - { name: 'form.type' } From da187d0bd1f92a10f7f28f81bae89cd77b1c8ff7 Mon Sep 17 00:00:00 2001 From: Maxime Veber Date: Tue, 25 Jun 2024 12:34:32 +0200 Subject: [PATCH 2/2] :memo: Update release note for release 0.10.4 --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aaba0ce..921f579 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.10.4] 2024-06-25 ### Added -- Fix version for Symfony 7 #79 +- Add support for any version of Symfony 7 #79 +- Make the Melodiia data mapper a service so it's overridable more easily globally #78 ## [0.10.3] 2024-06-04