25th / apigility-serializing-hydrator
Installs: 9 183
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 10
Forks: 1
Open Issues: 0
Requires
- php: >=5.4
- 25th/serializing: dev-master
This package is not auto-updated.
Last update: 2024-11-09 15:34:12 UTC
README
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',
]
]
]