FIX: Fix PaginatedList::toArray()

It wasn’t respecting pagination.
This commit is contained in:
Sam Minnee 2017-01-17 14:21:11 +13:00 committed by Guy Sartorelli
parent 6c136c9cf2
commit 1efe2b46ff
No known key found for this signature in database
GPG Key ID: F313E3B9504D496A

View File

@ -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 * Returns a set of links to all the pages in the list. This is useful for
* basic pagination. * basic pagination.