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:
@@ -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
|
||||
|
Reference in New Issue
Block a user