Files
spa-api/laravel/database/query/factory.php

28 lines
581 B
PHP
Raw Normal View History

<?php namespace Laravel\Database\Query;
2011-08-19 20:12:39 -05:00
use Laravel\Database\Query;
use Laravel\Database\Connection;
2011-08-19 20:12:39 -05:00
class Factory {
/**
2011-08-22 21:56:42 -05:00
* Create a new query instance based on the connection driver.
2011-08-19 20:12:39 -05:00
*
* @param Connection $connection
2011-08-22 21:56:42 -05:00
* @param Compiler $compiler
* @param string $table
2011-08-19 20:12:39 -05:00
* @return Query
*/
public function make(Connection $connection, Compiler $compiler, $table)
2011-08-19 20:12:39 -05:00
{
2011-08-22 21:56:42 -05:00
switch ($connection->driver())
2011-08-19 20:12:39 -05:00
{
2011-08-19 21:18:59 -05:00
case 'pgsql':
return new Postgres($connection, $compiler, $table);
2011-08-19 21:18:59 -05:00
2011-08-19 20:12:39 -05:00
default:
return new Query($connection, $compiler, $table);
2011-08-19 20:12:39 -05:00
}
}
}