ResultSetIterator.php

Go to the documentation of this file.
00001 <?php 00002 /* 00003 * $Id: ResultSetIterator.php,v 1.3 2004/03/15 17:47:45 hlellelid Exp $ 00004 * 00005 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00006 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00007 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00008 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00009 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00010 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00011 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00012 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00013 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00014 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00015 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00016 * 00017 * This software consists of voluntary contributions made by many individuals 00018 * and is licensed under the LGPL. For more information please see 00019 * <http://creole.phpdb.org>. 00020 */ 00021 00052 class ResultSetIterator implements Iterator { 00053 00054 private $rs; 00055 00060 public function __construct(ResultSet $rs) 00061 { 00062 $this->rs = $rs; 00063 } 00064 00069 function rewind() 00070 { 00071 if (!$this->rs->isBeforeFirst()) { 00072 $this->rs->seek(0); 00073 } 00074 } 00075 00081 function valid() 00082 { 00083 return $this->rs->next(); 00084 } 00085 00090 function key() 00091 { 00092 return $this->rs->getCursorPos(); 00093 } 00094 00099 function current() 00100 { 00101 return $this->rs->getRow(); 00102 } 00103 00109 function next() 00110 { 00111 } 00112 00113 }

This file is part of the Creole[php5] library.


Copyright © 2004 Hans Lellelid  
Creole[php5] CVS