Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
4b84bd96
Commit
4b84bd96
authored
Sep 02, 2015
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-73: Database and Collection should inherit Manager's WC and RP
parent
ced71457
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
Client.php
src/Client.php
+4
-8
No files found.
src/Client.php
View file @
4b84bd96
...
...
@@ -14,8 +14,6 @@ use MongoDB\Operation\ListDatabases;
class
Client
{
private
$manager
;
private
$readPreference
;
private
$writeConcern
;
/**
* Constructs a new Client instance.
...
...
@@ -77,9 +75,8 @@ class Client
public
function
selectCollection
(
$databaseName
,
$collectionName
,
WriteConcern
$writeConcern
=
null
,
ReadPreference
$readPreference
=
null
)
{
$namespace
=
$databaseName
.
'.'
.
$collectionName
;
// TODO: inherit from Manager options once PHPC-196 is implemented
$writeConcern
=
$writeConcern
?:
$this
->
writeConcern
;
$readPreference
=
$readPreference
?:
$this
->
readPreference
;
$writeConcern
=
$writeConcern
?:
$this
->
manager
->
getWriteConcern
();
$readPreference
=
$readPreference
?:
$this
->
manager
->
getReadPreference
();
return
new
Collection
(
$this
->
manager
,
$namespace
,
$writeConcern
,
$readPreference
);
}
...
...
@@ -97,9 +94,8 @@ class Client
*/
public
function
selectDatabase
(
$databaseName
,
WriteConcern
$writeConcern
=
null
,
ReadPreference
$readPreference
=
null
)
{
// TODO: inherit from Manager options once PHPC-196 is implemented
$writeConcern
=
$writeConcern
?:
$this
->
writeConcern
;
$readPreference
=
$readPreference
?:
$this
->
readPreference
;
$writeConcern
=
$writeConcern
?:
$this
->
manager
->
getWriteConcern
();
$readPreference
=
$readPreference
?:
$this
->
manager
->
getReadPreference
();
return
new
Database
(
$this
->
manager
,
$databaseName
,
$writeConcern
,
$readPreference
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment