enm / json-api-object-resource-mapper-bundle
Symfony integration for object resource mappers from enm/json-api-common
1.0.3
2020-01-02 12:38 UTC
Requires
- php: >=7.2
- enm/json-api-common: ^3.0
- symfony/dependency-injection: ^4.0
- symfony/http-kernel: ^2.7|^3.0|^4.0
Requires (Dev)
- phpunit/phpunit: ^6.3
This package is auto-updated.
Last update: 2024-10-29 04:47:49 UTC
README
Symfony integration for object and resource mappers from enm/json-api-server-common
Installation
composer require enm/json-api-server-common
in your AppKernel
:
<?php // config/bundles.php return [ // ... Enm\Bundle\JsonApi\Mapper\EnmJsonApiMapperBundle::class => ['all'=>true], // ... ];
Usage
Your object mappers must be defined as services and tagged with json_api.object_mapper
to be detected by this bundle.
Your resource mappers must be defined as services and tagged with json_api.resource_mapper
to be detected by this bundle.
services: app.mappers.example: class: App\Mappers\ExampleMapper # this mapper will implement object and resource mapper interface... tags: - { name: 'json_api.object_mapper' } - { name: 'json_api.resource_mapper' }
The registry service, which you will need for dependency injection, is Enm\JsonApi\Mapper\ObjectResourceMapper
.