-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathODBCDriverConnection.php
47 lines (39 loc) · 1.08 KB
/
ODBCDriverConnection.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php namespace Ccovey\ODBCDriver;
use Illuminate\Database\Connection;
use Illuminate\Database\Query\Grammars\Grammar;
class ODBCDriverConnection extends Connection
{
/**
* @return Query\Grammars\Grammar
*/
protected function getDefaultQueryGrammar()
{
$grammarConfig = $this->getGrammarConfig();
if ($grammarConfig) {
$packageGrammar = "Ccovey\\ODBCDriver\\Grammars\\" . $grammarConfig;
if (class_exists($packageGrammar)) {
return $this->withTablePrefix(new $packageGrammar);
}
$illuminateGrammar = "Illuminate\\Database\\Query\\Grammars\\" . $grammarConfig;
if (class_exists($illuminateGrammar)) {
return $this->withTablePrefix(new $illuminateGrammar);
}
}
return $this->withTablePrefix(new Grammar);
}
/**
* Default grammar for specified Schema
* @return Schema\Grammars\Grammar
*/
protected function getDefaultSchemaGrammar()
{
return $this->withTablePrefix(new Schema\Grammars\Grammar);
}
protected function getGrammarConfig()
{
if ($this->getConfig('grammar')) {
return $this->getConfig('grammar');
}
return false;
}
}