summaryrefslogtreecommitdiff
path: root/classes/ArrayRecordSet.php
blob: f05e0dbd539af306f0787bba206d3ab1b0f21203 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

/**
 * Really simple RecordSet to allow printTable of arrays.
 *
 * $Id: ArrayRecordSet.php,v 1.2 2005/05/02 15:47:25 chriskl Exp $
 */
class ArrayRecordSet {

	var $_array;
	var $_count;
	var $EOF = false;
	var $f;
	
	function ArrayRecordSet($data) {
		$this->_array = $data;
		$this->_count = count($this->_array);
		$this->f = reset($this->_array);
		if ($this->f === false) $this->EOF = true;
	}
	
	function recordCount() {
		return $this->_count;
	}
	
	function moveNext() {
		$this->f = next($this->_array);
		if ($this->f === false) $this->EOF = true;
	}
}

?>