1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-13 17:44:11 +02:00

added low-level methods createResultDriver() and DibiConnection::createResultSet()

This commit is contained in:
David Grudl
2010-11-02 13:59:05 +01:00
parent 33ef22b488
commit 32baabdeac
12 changed files with 179 additions and 12 deletions

View File

@@ -162,7 +162,7 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver, IDibiResultDri
throw new DibiDriverException(mysqli_error($this->connection), mysqli_errno($this->connection), $sql);
}
return is_object($this->resultSet) ? clone $this : NULL;
return is_object($this->resultSet) ? $this->createResultDriver($this->resultSet) : NULL;
}
@@ -268,6 +268,20 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver, IDibiResultDri
/**
* Result set driver factory.
* @param mysqli_result
* @return IDibiResultDriver
*/
public function createResultDriver(mysqli_result $resource)
{
$res = clone $this;
$res->resultSet = $resource;
return $res;
}
/********************* SQL ****************d*g**/