database refactoring for dependency injection and other general refactoring.

This commit is contained in:
Taylor Otwell
2011-09-04 21:45:37 -05:00
parent c2f5e7eeb5
commit 3e874867b8
5 changed files with 30 additions and 18 deletions

View File

@@ -8,20 +8,20 @@ class Factory {
/**
* Create a new query instance based on the connection driver.
*
* @param string $table
* @param Connection $connection
* @param Compiler $compiler
* @param string $table
* @return Query
*/
public static function make($table, Connection $connection, Compiler $compiler)
public function make(Connection $connection, Compiler $compiler, $table)
{
switch ($connection->driver())
{
case 'pgsql':
return new Postgres($table, $connection, $compiler);
return new Postgres($connection, $compiler, $table);
default:
return new Query($table, $connection, $compiler);
return new Query($connection, $compiler, $table);
}
}