2017 © Pedro Peláez
 

library apigility-serializing-hydrator

image

25th/apigility-serializing-hydrator

  • Sunday, November 2, 2014
  • by dready
  • Repository
  • 8 Watchers
  • 0 Stars
  • 8,368 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 1 % Grown

The README.md

Usage

Add the following to your module.config.php:, (*1)

'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:, (*2)

'zf-hal' => [
    'renderer' => [
        'default_hydrator' => 'SerializingHydrator',
    ],
]

Or you can specify it directly in one resource:, (*3)

'zf-hal' => [
    'metadata_map' => [
        'Your\\Project\\Foo' => [
            'identifier_name' => 'id',
            'route_name'      => 'api/foo',
            'hydrator'        => 'SerializingHydrator',
        ]
    ]
]

The Versions

02/11 2014

dev-master

9999999-dev

  Sources   Download

The Requires

 

by Martin Prebio