I am using a HydratorPluginManager
(Zend\Stdlib\Hydrator\HydratorPluginManager) to manage my hydrators in one single spot and to let the manager take care of validation of my hydrators (meaning checking if my hydrators properly implement the HydratorInterface
).
I have some hydrators that I created using factories like this:
'service_manager' => array(
'factories' => array(
'My\Hydrators\SomeHydrator' => 'My\Hydrators\SomeHydratorFactory'
)
)
After registering the factories in my config file these hydrators are without any problem available in my ServiceManager
using $serviceManager->get($name)
. Now I would like to connect my ServiceManager
to my HydratorManager
so that if I ask for a certain hydrator using:
$hydratorPluginManager->get($name)
where $name
is the alias used for registering. So in this example it would be:
$hydratorPluginManager->get('My\Hydrators\SomeHydrator');
My idea was that if I connect my ServiceManager
like this:
$hydratorPluginManager->setServiceLocator($serviceManager)
It should work. But it doesn't and I am very confused why this is not working...
Am I missing something here?