1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-30 09:19:48 +02:00

- added fluent SQL builders support in DibiConnection and DibiTable

This commit is contained in:
David Grudl
2008-09-13 16:38:59 +00:00
parent 96c69f5bed
commit 8c4211d5be
10 changed files with 124 additions and 17 deletions

View File

@@ -460,7 +460,7 @@ class dibi
*/
public static function command()
{
return new DibiFluent(self::getConnection());
return self::getConnection()->command();
}
@@ -472,7 +472,7 @@ class dibi
public static function select($args)
{
$args = func_get_args();
return self::command()->__call('select', $args);
return self::getConnection()->command()->__call('select', $args);
}
@@ -484,7 +484,7 @@ class dibi
*/
public static function update($table, array $args)
{
return self::command()->update('%n', $table)->set($args);
return self::getConnection()->update($table, $args);
}
@@ -496,8 +496,7 @@ class dibi
*/
public static function insert($table, array $args)
{
return self::command()->insert()
->into('%n', $table, '(%n)', array_keys($args))->values('%l', array_values($args));
return self::getConnection()->insert($table, $args);
}
@@ -508,7 +507,7 @@ class dibi
*/
public static function delete($table)
{
return self::command()->delete()->from('%n', $table);
return self::getConnection()->delete($table);
}