1
1
<?php namespace Jenssegers \Mongodb ;
2
2
3
+ use Illuminate \Database \Connection as BaseConnection ;
3
4
use MongoDB \Client ;
4
5
5
- class Connection extends \ Illuminate \ Database \Connection
6
+ class Connection extends BaseConnection
6
7
{
7
8
/**
8
9
* The MongoDB database handler.
@@ -44,14 +45,6 @@ public function __construct(array $config)
44
45
$ this ->useDefaultSchemaGrammar ();
45
46
}
46
47
47
- /**
48
- * @inheritdoc
49
- */
50
- protected function getDefaultPostProcessor ()
51
- {
52
- return new Query \Processor ;
53
- }
54
-
55
48
/**
56
49
* Begin a fluent query against a database collection.
57
50
*
@@ -60,9 +53,7 @@ protected function getDefaultPostProcessor()
60
53
*/
61
54
public function collection ($ collection )
62
55
{
63
- $ processor = $ this ->getPostProcessor ();
64
-
65
- $ query = new Query \Builder ($ this , $ processor );
56
+ $ query = new Query \Builder ($ this , $ this ->getPostProcessor ());
66
57
67
58
return $ query ->from ($ collection );
68
59
}
@@ -198,12 +189,28 @@ public function getDriverName()
198
189
return 'mongodb ' ;
199
190
}
200
191
192
+ /**
193
+ * @inheritdoc
194
+ */
195
+ protected function getDefaultPostProcessor ()
196
+ {
197
+ return new Query \Processor ();
198
+ }
199
+
200
+ /**
201
+ * @inheritdoc
202
+ */
203
+ protected function getDefaultQueryGrammar ()
204
+ {
205
+ return new Query \Grammar ();
206
+ }
207
+
201
208
/**
202
209
* @inheritdoc
203
210
*/
204
211
protected function getDefaultSchemaGrammar ()
205
212
{
206
- return new Schema \Grammar ;
213
+ return new Schema \Grammar () ;
207
214
}
208
215
209
216
/**
0 commit comments