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

- DibiFluent - added support for nested selects

- DibiFluent::__toString() returns NOT highlighted SQL
This commit is contained in:
David Grudl
2008-11-22 14:31:38 +00:00
parent fb2621eb04
commit 4b7b7de87a
2 changed files with 25 additions and 4 deletions

View File

@@ -239,6 +239,26 @@ class DibiConnection extends DibiObject
/**
* Generates and returns SQL query.
* @param array|mixed one or more arguments
* @return string
* @throws DibiException
*/
final public function sql($args)
{
$args = func_get_args();
$this->connect();
$trans = new DibiTranslator($this->driver);
if ($trans->translate($args)) {
return $trans->sql;
} else {
throw new DibiException('SQL translate error: ' . $trans->sql);
}
}
/**
* Generates and prints SQL query.
* @param array|mixed one or more arguments