Open xpavp03 opened 10 years ago
How cool it would be to write this:
$service = new \Ctct\Services\ListService($apiKey); $resultSet = $service->getContactsFromList($accessToken, $listId, $params); $iterator = new \Ctct\Util\ResultSetIterator($resultSet); foreach ($iterator as $contact) { print "First name: " . $contact->first_name . "<br>"; }
The iterator would traverse all items, fetching remaining results via the "next" parameter in the background if needed.
This should work for all ResultSets, not only for sets of Contacts.
What do you think? Should be easy to implement. Do you want me to?
This would definitely be an interesting way to handle it. I'd love to see what you come up with if you have the time - we wouldn't be able to work on this on our end in the near future.
How cool it would be to write this:
The iterator would traverse all items, fetching remaining results via the "next" parameter in the background if needed.
This should work for all ResultSets, not only for sets of Contacts.
What do you think? Should be easy to implement. Do you want me to?