Skip to content

Commit

Permalink
Fix compatibility issue with pagerfanta
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-redfern committed Jun 24, 2020
1 parent bfc7d12 commit 885ebe4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Change Log
==========

2020-06-24 - 1.2.4
------------------

* fix method calls when setting up pagination; calling `setCurrentPage` before `setMaxPerPage`
causes a failure with pagerfanta > 2.1.3.

2020-05-13 - 1.2.3
------------------

Expand Down
2 changes: 1 addition & 1 deletion src/ModelBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public function count(): int
*/
public function paginate(int $page = 1, int $perPage = 30): Pagerfanta
{
return (new Pagerfanta(new PaginatorAdapter($this)))->setCurrentPage($page)->setMaxPerPage($perPage);
return (new Pagerfanta(new PaginatorAdapter($this)))->setMaxPerPage($perPage)->setCurrentPage($page);
}

/**
Expand Down

0 comments on commit 885ebe4

Please sign in to comment.