soliantconsulting/soliantconsulting-apigility — pull request #7 by veewee (2013-12-04 11:51:36+00:00)
Title: Collection attributes should be set globally

By adding the Hal collection attributes to the ORM fetchAll class, the code does not work form ODM.
The total and count attributes + query params should be set globally in Zf\Hal\Collection and not in the doctrine library. By doing it globally, it is the same for every type of resource.

I altered the FetchAll objects to return a paginator adapter again. By doing this you can drop the AbstractCollection and just use the ORM pagination adapter, which does the same as the AbstractResource.
Even though I believe the attributes is the responsibility of Zf\Hal\Collection, I added it to the fetchAll method. In this way, it can be used in both ORM and ODM.

Now I have 1 problem while running the code. The count is always the default of the paginator (10). The itemsize is set after this method is called, so it is not reachable from the fetchAll method. So the count attribute will not work. This could be resolved in Zf\Hal\Collection though!