hello,
I'm starting to implement a mock cache adapter to test this Paginator PR :
https://github.com/zendframework/zf2/pull/5758For that, i started with a very minimal cache object to test pagination, and i came across an error because of the lack of getIterator() method on my cache object.
The error came from this line :
https://github.com/zendframework/zf2/blob/master/library/Zend/Paginator/Paginator.php#L710So it appears that Paginator has a dependency on the IterableInterface. (
http://framework.zend.com/manual/2.2/en/modules/zend.cache.storage.adapter.html#the-iterableinterface)
What can be done about this ?
- check that cache object is an IterableInterface in Paginator::setCache() and throw an exception if not (must be documented) ?
- do not use cache when iterator is needed and the cache doesn't implement it ?
- other ?