/** * @param Client $client * @param \MongoDB|string $database */ public function __construct(Client $client, $database) { $this->client = $client; if ($database instanceof \MongoDB) { $this->database = $database; $this->databaseName = $database->__toString(); } else { $this->databaseName = $database; } }
/** * Wrapper method for MongoDB::__toString(). * * @see http://www.php.net/manual/en/mongodb.--tostring.php * @return string */ public function __toString() { return $this->mongoDB->__toString(); }