__toString() public method

The name of this database
public __toString ( ) : string
return string Returns this database's name.
Exemplo n.º 1
0
 /**
  * @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;
     }
 }
Exemplo n.º 2
0
 /**
  * Wrapper method for MongoDB::__toString().
  *
  * @see http://www.php.net/manual/en/mongodb.--tostring.php
  * @return string
  */
 public function __toString()
 {
     return $this->mongoDB->__toString();
 }