_offset = $offset; $this->_count = $count; } /** * @return string representation of the instance */ public function serialize() { return serialize(array( 'it' => $this->getInnerIterator(), 'offset' => $this->_offset, 'count' => $this->_count, 'pos' => $this->getPosition(), )); } /** * @param string $data representation of the instance */ public function unserialize($data) { $dataArr = unserialize($data); $this->__construct($dataArr['it'], $dataArr['offset'], $dataArr['count']); $this->seek($dataArr['pos']+$dataArr['offset']); } }