Skip to content

Cast PagerFanta object to array returns unexpected result #24

Closed Answered by mbabker
I-Valchev asked this question in Q&A

You must be logged in to vote

You can't reliably cast PHP objects to arrays like that. You can call $pager->getCurrentPageResults() to get the current page results as an iterable (plain array or a class implementing the Traversable interface), and if necessary use the native iterator_to_array() function you convert the traversable class to an array.

Replies: 1 comment

You must be logged in to vote
0 replies
Answer selected by mbabker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #24 on December 08, 2020 17:25.