@@ -11,18 +11,21 @@ class Connection extends BaseConnection
11
11
{
12
12
/**
13
13
* The MongoDB database handler.
14
+ *
14
15
* @var \MongoDB\Database
15
16
*/
16
17
protected $ db ;
17
18
18
19
/**
19
20
* The MongoDB connection handler.
21
+ *
20
22
* @var \MongoDB\Client
21
23
*/
22
24
protected $ connection ;
23
25
24
26
/**
25
27
* Create a new database connection instance.
28
+ *
26
29
* @param array $config
27
30
*/
28
31
public function __construct (array $ config )
@@ -53,6 +56,7 @@ public function __construct(array $config)
53
56
54
57
/**
55
58
* Begin a fluent query against a database collection.
59
+ *
56
60
* @param string $collection
57
61
* @return Query\Builder
58
62
*/
@@ -65,6 +69,7 @@ public function collection($collection)
65
69
66
70
/**
67
71
* Begin a fluent query against a database collection.
72
+ *
68
73
* @param string $table
69
74
* @param string|null $as
70
75
* @return Query\Builder
@@ -76,6 +81,7 @@ public function table($table, $as = null)
76
81
77
82
/**
78
83
* Get a MongoDB collection.
84
+ *
79
85
* @param string $name
80
86
* @return Collection
81
87
*/
@@ -94,6 +100,7 @@ public function getSchemaBuilder()
94
100
95
101
/**
96
102
* Get the MongoDB database object.
103
+ *
97
104
* @return \MongoDB\Database
98
105
*/
99
106
public function getMongoDB ()
@@ -103,6 +110,7 @@ public function getMongoDB()
103
110
104
111
/**
105
112
* return MongoDB object.
113
+ *
106
114
* @return \MongoDB\Client
107
115
*/
108
116
public function getMongoClient ()
@@ -120,6 +128,7 @@ public function getDatabaseName()
120
128
121
129
/**
122
130
* Get the name of the default database based on db config or try to detect it from dsn.
131
+ *
123
132
* @param string $dsn
124
133
* @param array $config
125
134
* @return string
@@ -140,6 +149,7 @@ protected function getDefaultDatabaseName($dsn, $config)
140
149
141
150
/**
142
151
* Create a new MongoDB connection.
152
+ *
143
153
* @param string $dsn
144
154
* @param array $config
145
155
* @param array $options
@@ -175,6 +185,7 @@ public function disconnect()
175
185
176
186
/**
177
187
* Determine if the given configuration array has a dsn string.
188
+ *
178
189
* @param array $config
179
190
* @return bool
180
191
*/
@@ -185,6 +196,7 @@ protected function hasDsnString(array $config)
185
196
186
197
/**
187
198
* Get the DSN string form configuration.
199
+ *
188
200
* @param array $config
189
201
* @return string
190
202
*/
@@ -195,6 +207,7 @@ protected function getDsnString(array $config)
195
207
196
208
/**
197
209
* Get the DSN string for a host / port configuration.
210
+ *
198
211
* @param array $config
199
212
* @return string
200
213
*/
@@ -218,6 +231,7 @@ protected function getHostDsn(array $config)
218
231
219
232
/**
220
233
* Create a DSN string from a configuration.
234
+ *
221
235
* @param array $config
222
236
* @return string
223
237
*/
@@ -270,6 +284,7 @@ protected function getDefaultSchemaGrammar()
270
284
271
285
/**
272
286
* Set database.
287
+ *
273
288
* @param \MongoDB\Database $db
274
289
*/
275
290
public function setDatabase (\MongoDB \Database $ db )
@@ -279,6 +294,7 @@ public function setDatabase(\MongoDB\Database $db)
279
294
280
295
/**
281
296
* Dynamically pass methods to the connection.
297
+ *
282
298
* @param string $method
283
299
* @param array $parameters
284
300
* @return mixed
0 commit comments