@@ -42,32 +42,32 @@ public function dropDatabase($databaseName)
42
42
}
43
43
44
44
/**
45
- * Select a database
45
+ * Select a specific collection in a database
46
46
*
47
- * It acts as a bridge to access specific database commands
47
+ * It acts as a bridge to access specific collection commands
48
48
*
49
- * @param string $databaseName The database to select
49
+ * @param string $databaseName The database where the $collectionName exists
50
+ * @param string $collectionName The collection to select
50
51
* @param WriteConcern $writeConcern Default Write Concern to apply
51
52
* @param ReadPreference $readPreferences Default Read Preferences to apply
52
53
*/
53
- public function selectDatabase ($ databaseName , WriteConcern $ writeConcern = null , ReadPreference $ readPreferences = null )
54
+ public function selectCollection ($ databaseName, $ collectionName , WriteConcern $ writeConcern = null , ReadPreference $ readPreferences = null )
54
55
{
55
- return new Database ($ this ->manager , $ databaseName , $ writeConcern , $ readPreferences );
56
+ return new Collection ($ this ->manager , "{ $ databaseName} . { $ collectionName }" , $ writeConcern , $ readPreferences );
56
57
}
57
58
58
59
/**
59
- * Select a specific collection in a database
60
+ * Select a database
60
61
*
61
- * It acts as a bridge to access specific collection commands
62
+ * It acts as a bridge to access specific database commands
62
63
*
63
- * @param string $databaseName The database where the $collectionName exists
64
- * @param string $collectionName The collection to select
64
+ * @param string $databaseName The database to select
65
65
* @param WriteConcern $writeConcern Default Write Concern to apply
66
66
* @param ReadPreference $readPreferences Default Read Preferences to apply
67
67
*/
68
- public function selectCollection ($ databaseName, $ collectionName , WriteConcern $ writeConcern = null , ReadPreference $ readPreferences = null )
68
+ public function selectDatabase ($ databaseName , WriteConcern $ writeConcern = null , ReadPreference $ readPreferences = null )
69
69
{
70
- return new Collection ($ this ->manager , "{ $ databaseName} . { $ collectionName }" , $ writeConcern , $ readPreferences );
70
+ return new Database ($ this ->manager , $ databaseName , $ writeConcern , $ readPreferences );
71
71
}
72
72
73
73
}
0 commit comments