diff --git a/src/ORM/PaginatedList.php b/src/ORM/PaginatedList.php index f7289e9a8bd..2a0d6f07dbd 100644 --- a/src/ORM/PaginatedList.php +++ b/src/ORM/PaginatedList.php @@ -225,6 +225,21 @@ public function getIterator() } } + /** + * @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.