- Timestamp:
- 09/26/13 15:41:49 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.5.1-evolucao/phpgwapi/inc/adodb/adodb-iterator.inc.php
r34 r8222 2 2 3 3 /* 4 V 4.94 23 Jan 2007 (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved.4 V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved. 5 5 Released under both BSD license and Lesser GPL library license. 6 6 Whenever there is any discrepancy between the two licenses, … … 19 19 20 20 Iterator code based on http://cvs.php.net/cvs.php/php-src/ext/spl/examples/cachingiterator.inc?login=2 21 22 23 Moved to adodb.inc.php to improve performance. 21 24 */ 22 25 23 26 24 class ADODB_Iterator implements Iterator {25 27 26 private $rs;27 28 function __construct($rs)29 {30 $this->rs = $rs;31 }32 function rewind()33 {34 $this->rs->MoveFirst();35 }36 37 function valid()38 {39 return !$this->rs->EOF;40 }41 42 function key()43 {44 return $this->rs->_currentRow;45 }46 47 function current()48 {49 return $this->rs->fields;50 }51 52 function next()53 {54 $this->rs->MoveNext();55 }56 57 function __call($func, $params)58 {59 return call_user_func_array(array($this->rs, $func), $params);60 }61 62 63 function hasMore()64 {65 return !$this->rs->EOF;66 }67 68 }69 70 71 class ADODB_BASE_RS implements IteratorAggregate {72 function getIterator() {73 return new ADODB_Iterator($this);74 }75 76 /* this is experimental - i don't really know what to return... */77 function __toString()78 {79 include_once(ADODB_DIR.'/toexport.inc.php');80 return _adodb_export($this,',',',',false,true);81 }82 }83 28 84 29
Note: See TracChangeset
for help on using the changeset viewer.