zfcampus/zf-apigility-doctrine — pull request #91 by Tomdarkness (2014-06-09 23:34:46+00:00)
Title: Implement basic functionality "zoom" functionality

Bit of a WIP at the moment.

This implements the "zoom" functionality that was listed as a nice to have in the fetch function.

So what you can do is specify names of relationships in the zoom query parameter and these will be embedded in the response.

It does this by using a delegator factory to capture the creation of hydrators and force them to use the `CollectionExtract` strategy for the specified relationships. The relationships are also fetched using a left join for performance.

This is a WIP for the following reasons:

- Not familiar with ODM hence does not support it, if something similar could be supported anyway.
- No way to configure which relationships you'd like to have this functionality available on, just allows any relationship.
- Query is sub optimal since it can fetch more results in the query than may actually be included in the response.
- All possible child entities that could be fetched via the zoom functionality need to have a strategy configured on the reverse parent relationship to prevent infinite recursion.

Only just started working with apigility today so I'm not very familiar with exactly how everything works but hopefully I've not broken anything.