LMongo\DatabaseManager::connection PHP Method

connection() public method

Get a database connection instance.
public connection ( string $name = null ) : LMongo\Connection
$name string
return LMongo\Connection
    public function connection($name = null)
    {
        $name = $name ?: $this->getDefaultConnection();
        // If we haven't created this connection, we'll create it based on the config
        // provided in the application.
        if (!isset($this->connections[$name])) {
            $connection = $this->makeConnection($name);
            $this->connections[$name] = $this->prepare($connection);
        }
        return $this->connections[$name];
    }