From 1efe2b46ffcd524cbe0e5cbc1593be47e2de589a Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 17 Jan 2017 14:21:11 +1300 Subject: [PATCH] FIX: Fix PaginatedList::toArray() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It wasn’t respecting pagination. --- src/ORM/PaginatedList.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ORM/PaginatedList.php b/src/ORM/PaginatedList.php index f7289e9a8..2a0d6f07d 100644 --- a/src/ORM/PaginatedList.php +++ b/src/ORM/PaginatedList.php @@ -225,6 +225,21 @@ class PaginatedList extends ListDecorator } } + /** + * @return array + */ + public function toArray() + { + $result = []; + + // Use getIterator() + foreach($this as $record) { + $result[] = $record; + } + + return $result; + } + /** * Returns a set of links to all the pages in the list. This is useful for * basic pagination.