public function create(PDO $pdo)
    {
        switch ($pdo->getDatabaseType()) {
            case 'mysql':
                $connection = new MySqlConnection($pdo);
                break;
            case 'pgsql':
                $connection = new PostgreSqlConnection($pdo);
                break;
            case 'sqlite':
                $connection = new SQLiteConnection($pdo);
                break;
            default:
                throw new InvalidDriverException('Not implemented driver: ' . $pdo->getDatabaseType());
        }

        return $connection;
    }
public function create(PDO $pdo)
    {
        switch ($pdo->getDatabaseType()) {
            case 'mysql':
                $connection = new MySqlConnection($pdo);
                break;
            case 'pgsql':
                $connection = new PostgreSqlConnection($pdo);
                break;
            case 'sqlite':
                $connection = new SQLiteConnection($pdo);
                break;
            default:
                throw new InvalidDriverException('Not implemented driver: ' . $pdo->getDatabaseType());
        }

        return $connection;
    }
public function create ( PDO $ pdo ) { switch ( $ pdo -> getDatabaseType ( ) ) { case 'mysql' : $ connection = new MySqlConnection ( $ pdo ) ; break ; case 'pgsql' : $ connection = new PostgreSqlConnection ( $ pdo ) ; break ; case 'sqlite' : $ connection = new SQLiteConnection ( $ pdo ) ; break ; default : throw new InvalidDriverException ( 'Not implemented driver: ' . $ pdo -> getDatabaseType ( ) ) ; } return $ connection ; }
Create a new Connection based on the config

@param PDO $pdo

@return Connection
@throws InvalidDriverException
Create a new Connection based on the config