diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/Paginator/Adapter/Iterator.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Paginator/Adapter/Iterator.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,102 @@ +_iterator = $iterator; + $this->_count = count($iterator); + } + + /** + * Returns an iterator of items for a page, or an empty array. + * + * @param integer $offset Page offset + * @param integer $itemCountPerPage Number of items per page + * @return LimitIterator|array + */ + public function getItems($offset, $itemCountPerPage) + { + if ($this->_count == 0) { + return array(); + } + + // @link http://bugs.php.net/bug.php?id=49906 | ZF-8084 + // return new LimitIterator($this->_iterator, $offset, $itemCountPerPage); + return new Zend_Paginator_SerializableLimitIterator($this->_iterator, $offset, $itemCountPerPage); + } + + /** + * Returns the total number of rows in the collection. + * + * @return integer + */ + public function count() + { + return $this->_count; + } +} \ No newline at end of file