fix format
This commit is contained in:
parent
7163158baf
commit
2edd65d145
5 changed files with 407 additions and 388 deletions
|
|
@ -10,33 +10,33 @@ use TheSeer\Tokenizer\Exception;
|
|||
class PDOStatement extends \PDOStatement implements \IteratorAggregate
|
||||
{
|
||||
protected $cursorPos = 0;
|
||||
public $cache = array();
|
||||
public $cache = array();
|
||||
public $fields;
|
||||
|
||||
function getIterator(): \Iterator {
|
||||
return new StatementIterator($this);
|
||||
}
|
||||
|
||||
protected function __construct() {
|
||||
protected function __construct() {
|
||||
}
|
||||
|
||||
function rewind() {
|
||||
function rewind() {
|
||||
$this->cursorPos = 0;
|
||||
}
|
||||
|
||||
public function seek($rownum) {
|
||||
if ($rownum < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// PostgreSQL rows start w/ 0, but this works, because we are
|
||||
// looking to move the position _before_ the next desired position
|
||||
$this->cursorPos = $rownum;
|
||||
return true;
|
||||
}
|
||||
public function seek($rownum) {
|
||||
if ($rownum < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// PostgreSQL rows start w/ 0, but this works, because we are
|
||||
// looking to move the position _before_ the next desired position
|
||||
$this->cursorPos = $rownum;
|
||||
return true;
|
||||
}
|
||||
|
||||
function valid() {
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ class PDOStatement extends \PDOStatement implements \IteratorAggregate
|
|||
if ($this->getRecordCount() > $this->cursorPos) {
|
||||
if (!isset($this->cache[$this->cursorPos])) {
|
||||
$this->cache[$this->cursorPos] = $this->fetch(PDO::FETCH_ASSOC);
|
||||
}
|
||||
}
|
||||
$this->fields = $this->cache[$this->cursorPos];
|
||||
|
||||
$this->cursorPos++;
|
||||
|
|
@ -102,7 +102,7 @@ class PDOStatement extends \PDOStatement implements \IteratorAggregate
|
|||
function getRecordCount() {
|
||||
return count($this->cache);
|
||||
}
|
||||
|
||||
|
||||
function execute($args = null) {
|
||||
$result = parent::execute($args);
|
||||
return $result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue