clean up a few more things.

This commit is contained in:
Taylor Otwell
2011-09-17 23:55:36 -05:00
parent cb5a426cba
commit 7898094e25
2 changed files with 13 additions and 4 deletions

View File

@@ -13,7 +13,14 @@ class Connection {
protected $config;
/**
* The PDO connection.
* The query grammar instance for the connection.
*
* @var Grammars\Grammar
*/
protected $grammar;
/**
* The raw PDO connection instance.
*
* @var PDO
*/
@@ -127,13 +134,15 @@ class Connection {
*/
protected function grammar()
{
if (isset($this->grammar)) return $this->grammar;
switch (isset($this->config['grammar']) ? $this->config['grammar'] : $this->driver())
{
case 'mysql':
return new Grammars\MySQL;
return $this->grammar = new Grammars\MySQL;
default:
return new Grammars\Grammar;
return $this->grammar = new Grammars\Grammar;
}
}