soliantconsulting/soliantconsulting-apigility — pull request #13 by veewee (2013-12-09 16:35:35+00:00)
Title: Add configurable hydrator strategies

The Doctrine Hydrator gives me some issues with the extraction of ODM collections. I guess this is doctrine specific, but it is blocking. Therefore I decided to add configurable HydratorStrategies to the HydratorFactory.

Configuration sample:
```php
'FileSystemApi\\V1\\Rest\\Assets\\AssetsHydrator' => array(
'entity_class' => 'FileSystem\\Entity\\Asset',
'object_manager' => 'doctrine.documentmanager.odm_tenant',
'strategies' => array(
'metadata' => 'Application\\Hydrator\\Strategy\\PersistentCollection'
),
),
```

In this case, the 'metadata' field of the entity will by hydrated/extracted with a custom PersistentCollection HydratorStrategy. This strategy is loaded from the serviceManager.
This way it is much easier to create custom hydration / extraction rules, but still use the general doctrine hydrator.