Skip to content

Commit

Permalink
FIX: Fix PaginatedList::toArray()
Browse files Browse the repository at this point in the history
It wasn’t respecting pagination.
  • Loading branch information
Sam Minnee authored and GuySartorelli committed Sep 15, 2022
1 parent 6c136c9 commit 1efe2b4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/ORM/PaginatedList.php
Expand Up @@ -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.
Expand Down

0 comments on commit 1efe2b4

Please sign in to comment.