dbscript
[ class tree: dbscript ] [ index: dbscript ] [ all elements ]

Source for file genericiterator.php

Documentation is available at genericiterator.php

  1. <?php
  2.  
  3.   /** 
  4.    * dbscript for PHP 4 & 5 - restful crud framework
  5.    * @version 0.1.2 -- 19-Feb-2007
  6.    * @author Brian Hendrickson <brian@dbscript.net>
  7.    * @link http://dbscript.net/
  8.    * @copyright Copyright 2007 Brian Hendrickson
  9.    * @package dbscript
  10.    * @license http://www.opensource.org/licenses/mit-license.php MIT License
  11.    */
  12.  
  13.   /**
  14.    * Generic Iterator
  15.    * 
  16.    * For looping over arrays, directories, file contents, etc.
  17.    * 
  18.    * More info...
  19.    * {@link http://dbscript.net/genericiterator}
  20.    * 
  21.    * @package dbscript
  22.    * @author Brian Hendrickson <brian@dbscript.net>
  23.    * @access public
  24.    * @version 0.1.2
  25.    */
  26.  
  27. class GenericIterator {
  28.   
  29.   var $EOF;
  30.   var $_currentRow;
  31.   var $collection;
  32.   
  33.   function rewind({
  34.     $this->MoveFirst();
  35.   }
  36.   
  37.   function valid({
  38.     return !$this->EOF;
  39.   }
  40.   
  41.   function key({
  42.     return $this->_currentRow;
  43.   }
  44.   
  45.   function current({
  46.     $this->Load();
  47.   }
  48.   
  49.   function next({
  50.     $this->MoveNext();
  51.   }
  52.   
  53.   function call($func$params{
  54.     return call_user_func_array(array($this->collection$func)$params);
  55.   }
  56.   
  57.   function hasMore({
  58.     return !$this->EOF;
  59.   }
  60.   
  61. }
  62.  
  63. ?>

Documentation generated on Mon, 19 Feb 2007 10:24:45 -0800 by phpDocumentor 1.3.1