cronofy / cronofy-php

Cronofy PHP library

Home Page:https://docs.cronofy.com/developers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement \Iterator on PagedResultIterator

armetiz opened this issue · comments

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.

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!