I have created a resource that when fetched GET /resource/{id}
returns a response (on success/found) with the following template:
Resource:
{
"name": "Name",
"code" "Code",
"_embedded" : {
"foos" : [{
"name" : "bar1",
"value" : "value1",
},
{
"name" : "bar2",
"value" : "value2",
}]
}
}
Code for fetch($id)
fetch($id){
$resource = ... // query resource
$resourceEntity = new ResourceEntity();
$resourceEntity->exchangeArray($resource);
$foos = ... // query foos
$fooAdapter = new Adapter\ArrayAdapter($foos);
$fooCollection = new Foo\FooCollection($fooAdapter);
$resourceEntity->foos = $fooCollection;
return $resourceEntity;
}
My problem is that when the fooCollection consists of more than 10 entities only 10 entities gets rendered in response.
Things I tried so far:
I checked if this has to do with the
default page size
of theFooCollection
in themodule.config.php
but the setting is equal to 25 in my case.I tried to look at the Zend documentation to see if I can force the
Paginator
to be set to -1, since by doing so (I think) will not paginate the result.I tried not used a Collection to just a plain array for the
"foos"
property. I showed all the results but it did not render eachfoo
entities as aHAL
entity