Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit f78468c

Browse files
committed
docs: note that setFirstResult() SHOULD NOT be called
It is called by the ExtractCollection trait, using the discovered page number and number of results to retrieve.
1 parent fe80d5d commit f78468c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/book/doctrine.md

+10
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,16 @@ seed a collection paginator (in the case of the `ListAlbumsHandler`). These
365365
values are known by the metadata map, and, as such, we can generate HAL
366366
resources for them without needing any other information.
367367

368+
> ### Setting the offset
369+
>
370+
> When you plan to use paginated Doctrine result sets, you DO NOT need to
371+
> call `$query->setFirstResult()`. This will be called when generating the
372+
> result set based on the current page and the value of
373+
> `$query->getMaxResults()`.
374+
>
375+
> You MUST call `$query->setMaxResults()` prior to generating your resource if
376+
> you want it to be paginated, however.
377+
368378
## Example: Doctrine Collections
369379

370380
Sometimes we will want to return an entire collection at once. The `getResult()`

0 commit comments

Comments
 (0)