mongo-php-library
mongo-php-library copied to clipboard
PHPLIB-1185: Add new methods to get database and collection instances
PHPLIB-1185
This PR adds the following new methods:
Client::getDatabase, changedClient::selectDatabaseandClient::__getto proxy to this methodClient::getCollection, changedClient::selectCollectionto proxy to this methodDatabase::getCollection, changedDatabase::selectCollectionandDatabase::__getto proxy to this method
Since they are widely used, I did not add any deprecation warnings, nor did I add any language to the documentation to indicate that they are deprecated. I left the tests as they are, as the old methods were changed to proxy to the new methods, so we are implicitly testing them. I can duplicate the existing tests, but I don't think this is necessary.
As a follow-up to this PR, we should update the documentation to use the new get(Database|Collection) methods, starting in 2.0 (as we only maintain a single documentation for 1.x, so users would have to figure out which method is correct for their version).