nur-sery/nur_src/m/base/OneRowIterator.php

25 lines
471 B
PHP
Raw Normal View History

2023-12-03 22:10:18 +04:00
<?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(); }
}