zfcampus/zf-hal — pull request #6 by TomHAnderson (2013-12-09 02:14:06+00:00)
Title: Doctrine Embedded Persistent Collections

As it has been suggested https://github.com/soliantconsulting/soliantconsulting-apigility be merged into zfcampus, requirements have arisen which require doctrine specific handling of data types in zf-hal.

DoctrineEntity hydrator returns PersistentCollection for collections. The hydrator also returns data for collections but I feel handling collections as _links instead of embedded collections is a more precise method. So this patch, specific to ORM and @veewee we'll probably have ODM specific code too, adds to the _links.

This approach gives a one-level API where all collections are accessed using filters from their related resources.

A lot of input has gone into this discussion so far and the other option to what I've implemented here is /route/entity/relationalCollection/otherRelationalCollection. I think this has very good standing for it's style but it feels like a specialized API is needed to support this. So, until someone builds an API to support this approach which is implemented cleanly and clearer than my one-level entity solution, I will continue to favor this solution.

https://github.com/zfcampus/zf-apigility/issues/10
https://github.com/zfcampus/zf-apigility/issues/11#issuecomment-30023278
https://github.com/soliantconsulting/soliantconsulting-apigility/issues/10

@thinkscape