fix format
This commit is contained in:
parent
7163158baf
commit
2edd65d145
5 changed files with 407 additions and 388 deletions
|
|
@ -10,40 +10,40 @@ class StatementIterator implements \Iterator
|
|||
private $pos = 0;
|
||||
private $fetchmode;
|
||||
private $row_count;
|
||||
|
||||
|
||||
public function __construct($rs/*: PDOStatement*/) {
|
||||
$this->result = $rs;
|
||||
$this->row_count = $rs->getRecordCount();
|
||||
$this->row_count = $rs->getRecordCount();
|
||||
}
|
||||
|
||||
function rewind() {
|
||||
|
||||
function rewind() {
|
||||
$this->pos = 0;
|
||||
}
|
||||
|
||||
|
||||
function valid() {
|
||||
return ($this->pos < $this->row_count);
|
||||
return ($this->pos < $this->row_count);
|
||||
}
|
||||
|
||||
|
||||
function key() {
|
||||
return $this->pos;
|
||||
}
|
||||
|
||||
|
||||
function current() {
|
||||
if (!isset($this->result->cache[$this->pos])) {
|
||||
$this->result->cache[$this->pos] = $this->result->fetch(PDO::FETCH_ASSOC);
|
||||
}
|
||||
}
|
||||
return $this->result->cache[$this->pos];
|
||||
}
|
||||
|
||||
|
||||
function next() {
|
||||
$this->pos++;
|
||||
}
|
||||
|
||||
function seek($index) {
|
||||
$this->pos = $index;
|
||||
$this->pos = $index;
|
||||
}
|
||||
|
||||
function count() {
|
||||
return $this->row_count;
|
||||
return $this->row_count;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue