1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 14:16:39 +02:00

- DibiConnection & DibiTranslator refactoring

- DibiException accepts SQL parameter
- undeprecated IDataSource
This commit is contained in:
David Grudl
2009-02-05 21:08:00 +00:00
parent 32ed383326
commit 46d79fc305
7 changed files with 89 additions and 67 deletions

View File

@@ -27,7 +27,7 @@
* @copyright Copyright (c) 2005, 2009 David Grudl
* @package dibi
*/
class DibiFluent extends DibiObject implements Countable, IteratorAggregate
class DibiFluent extends DibiObject implements IDataSource
{
/** @var array */
public static $masks = array(
@@ -133,7 +133,7 @@ class DibiFluent extends DibiObject implements Countable, IteratorAggregate
} elseif (is_string(key($arg))) { // associative array
$args = array('%a', $arg);
}
}
} // case $arg === FALSE is handled below
}
if (array_key_exists($clause, $this->clauses)) {
@@ -413,6 +413,16 @@ class DibiFluent extends DibiObject implements Countable, IteratorAggregate
/**
* @return DibiDataSource
*/
public function toDataSource()
{
return new DibiDataSource($this->connection->sql($this->_export()), $this->connection);
}
/**
* Returns SQL query.
* @return string