dataset = new WactArrayIterator(array()); } function registerDataset($dataset) { $this->dataset = WactTemplate :: castToIterator($dataset); $this->cached_count = null; } function getDataset() { return $this->dataset; } function rewind() { $this->dataset->rewind(); } function count() { if(is_null($this->cached_count)) $this->cached_count = $this->dataset->count(); return $this->cached_count; } function countPaginated() { if(method_exists($this->dataset, 'countPaginated')) return $this->dataset->countPaginated(); else return $this->count(); } function next() { $this->dataset->next(); } function valid() { return $this->dataset->valid(); } function key() { return $this->dataset->key(); } function current() { return $this->dataset->current(); } function getOffset() { return $this->dataset->getOffset(); } } ?>