Skip to content

Commit

Permalink
Merge pull request #78 from swagindustries/feature/register-api-type
Browse files Browse the repository at this point in the history
✨ Allow to override the data mapper of the api type
  • Loading branch information
BorbagUskada committed Jun 25, 2024
2 parents f3118b8 + da187d0 commit 680d2df
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/MelodiiaExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
9 changes: 9 additions & 0 deletions src/Resources/config/form.yaml
Original file line number Diff line number Diff line change
@@ -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' }

0 comments on commit 680d2df

Please sign in to comment.