public function get(string $name = null): DatabaseConnection
    {
        if (null == $name) {
            $name = DatabaseConfiguration::DEFAULT_ID;
        }

        if (isset($this->connections[$name])) {
            return $this->connections[$name];
        }

        $this->connections[$name] = new PdoDatabaseConnection(
                $this->configurations->get($name)
        );
        return $this->connections[$name];
    }
public function get(string $name = null): DatabaseConnection
    {
        if (null == $name) {
            $name = DatabaseConfiguration::DEFAULT_ID;
        }

        if (isset($this->connections[$name])) {
            return $this->connections[$name];
        }

        $this->connections[$name] = new PdoDatabaseConnection(
                $this->configurations->get($name)
        );
        return $this->connections[$name];
    }
public function get ( string $ name = null ) : DatabaseConnection { if ( null == $ name ) { $ name = DatabaseConfiguration :: DEFAULT_ID ; } if ( isset ( $ this -> connections [ $ name ] ) ) { return $ this -> connections [ $ name ] ; } $ this -> connections [ $ name ] = new PdoDatabaseConnection ( $ this -> configurations -> get ( $ name ) ) ; return $ this -> connections [ $ name ] ; }
returns the connection

If a name is provided and a connection with this name exists this
connection will be returned. If fallback is enabled and the named
connection does not exist the default connection will be returned, if
fallback is disabled a DatabaseException will be thrown.

If no name is provided the default connection will be returned.

@param   string  $name
@return  \stubbles\db\DatabaseConnection
returns the connection