https://github.com/25th-floor/apigility-serializing-hydrator
https://github.com/25th-floor/apigility-serializing-hydrator
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/25th-floor/apigility-serializing-hydrator
- Owner: 25th-floor
- Created: 2014-02-13T16:21:44.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-11-02T15:00:38.000Z (over 10 years ago)
- Last Synced: 2025-01-20T19:14:32.359Z (4 months ago)
- Language: PHP
- Size: 115 KB
- Stars: 0
- Watchers: 10
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Usage
Add the following to your module.config.php:
'invokables' => [
'TwentyFifth\Hydrator\SerializingHydrator' => 'TwentyFifth\Hydrator\SerializingHydrator',
],
'initializers' => [
function ($instance, ServiceManager $sm) {
if ($instance instanceof \Zend\Stdlib\Hydrator\HydratorPluginManager) {
$instance->setInvokableClass('SerializingHydrator', 'TwentyFifth\Hydrator\SerializingHydrator');
}
}
],Then you can either set the hydrator as default:
'zf-hal' => [
'renderer' => [
'default_hydrator' => 'SerializingHydrator',
],
]Or you can specify it directly in one resource:
'zf-hal' => [
'metadata_map' => [
'Your\\Project\\Foo' => [
'identifier_name' => 'id',
'route_name' => 'api/foo',
'hydrator' => 'SerializingHydrator',
]
]
]