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

Commit

Permalink
docs: note that setFirstResult() SHOULD NOT be called
Browse files Browse the repository at this point in the history
It is called by the ExtractCollection trait, using the discovered page
number and number of results to retrieve.
  • Loading branch information
weierophinney committed Feb 11, 2019
1 parent fe80d5d commit f78468c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/book/doctrine.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,16 @@ seed a collection paginator (in the case of the `ListAlbumsHandler`). These
values are known by the metadata map, and, as such, we can generate HAL
resources for them without needing any other information.

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

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

0 comments on commit f78468c

Please sign in to comment.