Implement \Iterator on PagedResultIterator
armetiz opened this issue · comments
Thomas Tourlourat commented
Hi there.
Right now, dealing with events is not friendly at all.
If PagedResultIterator implement \Iterator SPL interface.
Developers could use map functions to do the following:
$events = $cronofy->read_events();
$summaries = array_map(function(array $event) {
return $event['summary'];
}, iterator_to_array($events));
It's just an example; but It could be really useful for many use-cases.
Regards;
Thomas.
Stephen Binns commented
Hi Thomas,
I'm not a PHP Expert but I think #54 fixes this do you mind giving it a look over and test from your end?
Thanks!