File: ArrayRecordSet.php

package info (click to toggle)
phppgadmin 4.2.3-1.1squeeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 5,396 kB
  • ctags: 6,174
  • sloc: php: 68,599; makefile: 215; sh: 41; sql: 16; awk: 9
file content (32 lines) | stat: -rw-r--r-- 600 bytes parent folder | download | duplicates (6)
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.3 2007/01/10 01:46:28 soranzo Exp $
 */
class ArrayRecordSet {

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

?>