ResultSetIterator.php

Go to the documentation of this file.
00001 <?php 00002 /* 00003 * $Id: ResultSetIterator.php,v 1.1 2004/03/25 22:59:39 micha 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 00022 // 00023 // STATUS: 00024 // - ported: y 00025 // - compiled: y 00026 // - tested: n 00027 // 00028 00059 class ResultSetIterator /* implements Iterator */ 00060 { 00061 00062 var $rs; 00063 00068 function ResultSetIterator(/*ResultSet*/ &$rs) 00069 { 00070 if (! is_a($rs, 'ResultSet')) { 00071 trigger_error( 00072 "ResultSetIterator::ResultSetIterator(): parameter 1 not of type 'ResultSet' !", 00073 E_USER_ERROR 00074 ); 00075 } 00076 00077 $this->rs =& $rs; 00078 } 00079 00084 function rewind() 00085 { 00086 if (!$this->rs->isBeforeFirst()) { 00087 $this->rs->seek(0); 00088 } 00089 } 00090 00096 function & hasMore() 00097 { 00098 return $this->rs->next(); 00099 } 00100 00105 function key() 00106 { 00107 return $this->rs->getCursorPos(); 00108 } 00109 00114 function & current() 00115 { 00116 return $this->rs->getRow(); 00117 } 00118 00124 function next() 00125 { 00126 } 00127 00128 }

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


Copyright © 2004 Hans Lellelid  
Creole[php4] CVS