@@ 484-496 (lines=13) @@ | ||
481 | /** |
|
482 | * @return \MongoDB\Database |
|
483 | */ |
|
484 | private function createDatabaseObject() |
|
485 | { |
|
486 | $options = [ |
|
487 | 'readPreference' => $this->readPreference, |
|
488 | 'writeConcern' => $this->writeConcern, |
|
489 | ]; |
|
490 | ||
491 | if ($this->db === null) { |
|
492 | $this->db = $this->connection->getClient()->selectDatabase($this->name, $options); |
|
493 | } else { |
|
494 | $this->db = $this->db->withOptions($options); |
|
495 | } |
|
496 | } |
|
497 | ||
498 | private function checkDatabaseName($name) |
|
499 | { |
@@ 853-865 (lines=13) @@ | ||
850 | /** |
|
851 | * @return \MongoDB\Collection |
|
852 | */ |
|
853 | private function createCollectionObject() |
|
854 | { |
|
855 | $options = [ |
|
856 | 'readPreference' => $this->readPreference, |
|
857 | 'writeConcern' => $this->writeConcern, |
|
858 | ]; |
|
859 | ||
860 | if ($this->collection === null) { |
|
861 | $this->collection = $this->db->getDb()->selectCollection($this->name, $options); |
|
862 | } else { |
|
863 | $this->collection = $this->collection->withOptions($options); |
|
864 | } |
|
865 | } |
|
866 | ||
867 | /** |
|
868 | * Converts legacy write concern options to a WriteConcern object |