added useful toArray() method on Iterator

This commit is contained in:
Andy Miller
2014-12-05 08:17:42 -07:00
parent 3ba491d02c
commit 92159d1df8

View File

@@ -45,6 +45,16 @@ class Iterator implements \ArrayAccess, \Iterator, \Countable, \Serializable
}
}
/**
* Return the internal array used in this Iterator
*
* @return array
*/
public function toArray()
{
return $this->items;
}
/**
* Convents iterator to a comma separated list.
*