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

Fixes offset calculation for paginated Doctrine collections #56

Conversation

weierophinney
Copy link
Member

The code was erroneously using the calculated $pageCount, which represented the total number of pages in the collection, instead of the $perPage value when calculating the result offset. This was due to missing assertions in the unit tests. The assertions have been added, and the code corrected accordingly.

The code was erroneously using the calculated `$pageCount`, which
represented the total number of pages in the collection, instead of the
`$perPage` value when calculating the result offset. This was due to
missing assertions in the unit tests. The assertions have been added,
and the code corrected accordingly.
It is called by the ExtractCollection trait, using the discovered page
number and number of results to retrieve.
@weierophinney weierophinney merged commit 0d3c83f into zendframework:master Feb 11, 2019
weierophinney added a commit that referenced this pull request Feb 11, 2019
weierophinney added a commit that referenced this pull request Feb 11, 2019
@weierophinney weierophinney deleted the hotfix/fix-pagination-offset-calculation branch February 11, 2019 21:11
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant