25 lines
		
	
	
		
			471 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			471 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
namespace nur\m\base;
 | 
						|
 | 
						|
/**
 | 
						|
 * Class OneRowIterator: un itérateur qui retourne un seul élément déterminé
 | 
						|
 * d'avance
 | 
						|
 */
 | 
						|
class OneRowIterator extends AbstractRowIterator {
 | 
						|
  private $row;
 | 
						|
 | 
						|
  function __construct($row) {
 | 
						|
    parent::__construct();
 | 
						|
    $this->row = $row;
 | 
						|
  }
 | 
						|
 | 
						|
  function _next() {
 | 
						|
    $row = $this->row;
 | 
						|
    $this->row = false;
 | 
						|
    return $row;
 | 
						|
  }
 | 
						|
 | 
						|
  function key() { return $this->_key(); }
 | 
						|
  function current() { return $this->_current(); }
 | 
						|
}
 |