#andrea-skuola-pagination

1 messages · Page 1 of 1 (latest)

smoky heath
sharp hedge
#

ok and if I limit to 3 records $subscriptions = $stripe->subscriptions->all(['limit' => 3]);

#

and use this foreach ($subscriptions->autoPagingIterator() as $subscription){

#

why am i getting more than 3 results?

smoky heath
#

Because the iterator will continue making API requests for a limit of 3 at a time

sharp hedge
#

ok, so if i want only 3 i need to remove the autoIterator

smoky heath
#

You just don't need to paginate if you only want the most recent 3

sharp hedge
#

ok, because i'm creating a command and probably i need this two behaviors

#

so I wanted to use the same foreach

#

changing only the subscription passed

#

an execution probably with all subscription, and another execution probably with only 3 or less

smoky heath
#

Does that unblock you then?

sharp hedge
#

what?