public static function create(array $parameters): ?Connection
    {
        $params = [
            'driver' => 'pdo_mysql',
            'host' => $parameters['parameters']['database_host'],
            'port' => $parameters['parameters']['database_port'],
            'user' => $parameters['parameters']['database_user'],
            'password' => $parameters['parameters']['database_password'],
            'dbname' => $parameters['parameters']['database_name'],
        ];

        try {
            return DriverManager::getConnection($params);
        } catch (DBALException $e) {
            // ignore
        }

        return null;
    }
public static function create(array $parameters): ?Connection
    {
        $params = [
            'driver' => 'pdo_mysql',
            'host' => $parameters['parameters']['database_host'],
            'port' => $parameters['parameters']['database_port'],
            'user' => $parameters['parameters']['database_user'],
            'password' => $parameters['parameters']['database_password'],
            'dbname' => $parameters['parameters']['database_name'],
        ];

        try {
            return DriverManager::getConnection($params);
        } catch (DBALException $e) {
            // ignore
        }

        return null;
    }
public static function create ( array $ parameters ) : ? Connection { $ params = [ 'driver' => 'pdo_mysql' , 'host' => $ parameters [ 'parameters' ] [ 'database_host' ] , 'port' => $ parameters [ 'parameters' ] [ 'database_port' ] , 'user' => $ parameters [ 'parameters' ] [ 'database_user' ] , 'password' => $ parameters [ 'parameters' ] [ 'database_password' ] , 'dbname' => $ parameters [ 'parameters' ] [ 'database_name' ] , ] ; try { return DriverManager :: getConnection ( $ params ) ; } catch ( DBALException $ e ) { // ignore } return null ; }
Returns the database connection object.
Returns the database connection object .