コード例 #1
0
ファイル: MongoDB.php プロジェクト: alcaeus/mongo-php-adapter
 /**
  * @return \MongoDB\Database
  */
 private function createDatabaseObject()
 {
     $options = ['readPreference' => $this->readPreference, 'writeConcern' => $this->writeConcern];
     if ($this->db === null) {
         $this->db = $this->connection->getClient()->selectDatabase($this->name, $options);
     } else {
         $this->db = $this->db->withOptions($options);
     }
 }