1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-08 23:26:49 +02:00

added IDibiDriver::getReflector()

This commit is contained in:
David Grudl
2010-08-05 21:03:08 +02:00
parent 9f982cb310
commit 65b5e2eecd
12 changed files with 118 additions and 4 deletions

View File

@@ -664,11 +664,8 @@ class DibiConnection extends DibiObject
*/
public function getDatabaseInfo()
{
if (!($this->driver instanceof IDibiReflector)) {
throw new NotSupportedException('Driver '. get_class($this->driver) . ' has not reflection capabilities.');
}
$this->connected || $this->connect();
return new DibiDatabaseInfo($this->driver, isset($this->config['database']) ? $this->config['database'] : NULL);
return new DibiDatabaseInfo($this->driver->getReflector(), isset($this->config['database']) ? $this->config['database'] : NULL);
}

View File

@@ -151,6 +151,12 @@ interface IDibiDriver
*/
function getResource();
/**
* Returns the connection reflector.
* @return IDibiReflector
*/
function getReflector();
/**
* Encodes data for use in a SQL statement.
* @param string value