Set the query grammar used by the connection.
public setQueryGrammar ( Illuminate\Database\Query\Grammars\Grammar $grammar ) : void | ||
$grammar | Illuminate\Database\Query\Grammars\Grammar | |
Результат | void |
/** * Returns the database connection. * * @return \Illuminate\Database\Connection * @throws \InvalidArgumentException */ public function getConnection() { if ($this->connection === null) { $this->connection = new Connection($this->pdo, '', $this->tablePrefix); // We will now provide the query grammar to the connection. switch ($this->driverName) { case 'mysql': $queryGrammar = 'Illuminate\\Database\\Query\\Grammars\\MySqlGrammar'; break; case 'pgsql': $queryGrammar = 'Illuminate\\Database\\Query\\Grammars\\PostgresGrammar'; break; case 'sqlsrv': $queryGrammar = 'Illuminate\\Database\\Query\\Grammars\\SqlServerGrammar'; break; case 'sqlite': $queryGrammar = 'Illuminate\\Database\\Query\\Grammars\\SQLiteGrammar'; break; default: throw new \InvalidArgumentException("Cannot determine grammar to use based on {$this->driverName}."); break; } $this->connection->setQueryGrammar(new $queryGrammar()); } return $this->connection; }