Commit 048cb6ef authored by Ian Jenkins's avatar Ian Jenkins

Revert mysqli changes.

I don't really understand the mysqli driver too much and the changes
break the tests so undo using an iterator for this particular driver.
parent 55b672f4
<?php
namespace Doctrine\DBAL\Driver\Mysqli;
use Doctrine\DBAL\Driver\AbstractIterator;
class MysqliIterator extends AbstractIterator implements \Iterator
{
protected function fetch()
{
switch ($this->defaultFetchMode) {
case \PDO::FETCH_COLUMN:
return $this->fetchColumn();
default:
return $this->fetch($this->defaultFetchMode);
}
}
}
...@@ -406,6 +406,8 @@ class MysqliStatement implements \IteratorAggregate, Statement ...@@ -406,6 +406,8 @@ class MysqliStatement implements \IteratorAggregate, Statement
*/ */
public function getIterator() public function getIterator()
{ {
return new MysqliIterator($this->_stmt, $this->_defaultFetchMode); $data = $this->fetchAll();
return new \ArrayIterator($data);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment