protected function getPdoConnection($datasource)
    {
        $buildConnection = $this->getConnection($datasource);
        $dsn = str_replace("@DB@", $datasource, $buildConnection['dsn']);

        // Set user + password to null if they are empty strings or missing
        $username = isset($buildConnection['user']) && $buildConnection['user'] ? $buildConnection['user'] : null;
        $password = isset($buildConnection['password']) && $buildConnection['password'] ? $buildConnection['password'] : null;

        $pdo = new PDO($dsn, $username, $password);
        $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

        return $pdo;
    }
protected function getPdoConnection($datasource)
    {
        $buildConnection = $this->getConnection($datasource);
        $dsn = str_replace("@DB@", $datasource, $buildConnection['dsn']);

        // Set user + password to null if they are empty strings or missing
        $username = isset($buildConnection['user']) && $buildConnection['user'] ? $buildConnection['user'] : null;
        $password = isset($buildConnection['password']) && $buildConnection['password'] ? $buildConnection['password'] : null;

        $pdo = new PDO($dsn, $username, $password);
        $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

        return $pdo;
    }
protected function getPdoConnection ( $ datasource ) { $ buildConnection = $ this -> getConnection ( $ datasource ) ; $ dsn = str_replace ( "@DB@" , $ datasource , $ buildConnection [ 'dsn' ] ) ; // Set user + password to null if they are empty strings or missing $ username = isset ( $ buildConnection [ 'user' ] ) && $ buildConnection [ 'user' ] ? $ buildConnection [ 'user' ] : null ; $ password = isset ( $ buildConnection [ 'password' ] ) && $ buildConnection [ 'password' ] ? $ buildConnection [ 'password' ] : null ; $ pdo = new PDO ( $ dsn , $ username , $ password ) ; $ pdo -> setAttribute ( PDO :: ATTR_ERRMODE , PDO :: ERRMODE_EXCEPTION ) ; return $ pdo ; }
Gets a PDO connection for a given datasource.

@return PDO
Gets a PDO connection for a given datasource .