00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 class ADODB_Iterator implements Iterator {
00025
00026 private $rs;
00027
00028 function __construct($rs)
00029 {
00030 $this->rs = $rs;
00031 }
00032 function rewind()
00033 {
00034 $this->rs->MoveFirst();
00035 }
00036
00037 function valid()
00038 {
00039 return !$this->rs->EOF;
00040 }
00041
00042 function key()
00043 {
00044 return $this->rs->_currentRow;
00045 }
00046
00047 function current()
00048 {
00049 return $this->rs->fields;
00050 }
00051
00052 function next()
00053 {
00054 $this->rs->MoveNext();
00055 }
00056
00057 function __call($func, $params)
00058 {
00059 return call_user_func_array(array($this->rs, $func), $params);
00060 }
00061
00062
00063 function hasMore()
00064 {
00065 return !$this->rs->EOF;
00066 }
00067
00068 }
00069
00070
00071 class ADODB_BASE_RS implements IteratorAggregate {
00072 function getIterator() {
00073 return new ADODB_Iterator($this);
00074 }
00075
00076
00077 function __toString()
00078 {
00079 include_once(ADODB_DIR.'/toexport.inc.php');
00080 return _adodb_export($this,',',',',false,true);
00081 }
00082 }
00083
00084
00085 ?>