public function getDatabase($name = null, $refresh = false)
    {
        if ($name === null) {
            $name = $this->getDefaultDatabaseName();
        }
        if ($refresh || !array_key_exists($name, $this->_databases)) {
            $this->_databases[$name] = $this->selectDatabase($name);
        }

        return $this->_databases[$name];
    }
public function getDatabase($name = null, $refresh = false)
    {
        if ($name === null) {
            $name = $this->getDefaultDatabaseName();
        }
        if ($refresh || !array_key_exists($name, $this->_databases)) {
            $this->_databases[$name] = $this->selectDatabase($name);
        }

        return $this->_databases[$name];
    }
public function getDatabase ( $ name = null , $ refresh = false ) { if ( $ name === null ) { $ name = $ this -> getDefaultDatabaseName ( ) ; } if ( $ refresh || ! array_key_exists ( $ name , $ this -> _databases ) ) { $ this -> _databases [ $ name ] = $ this -> selectDatabase ( $ name ) ; } return $ this -> _databases [ $ name ] ; }
Returns the MongoDB database with the given name.
@param string|null $name database name, if null default one will be used.
@param bool $refresh whether to reestablish the database connection even, if it is found in the cache.
@return Database database instance.
Returns the MongoDB database with the given name .