protected function getConnection($uri)
    {
        if ($this->pdo) {
            return; //Already have a connection
        }

        $this->splitURI($uri);

        try {
            $this->pdo = new PDO($this->dsn, $this->user, $this->passwd);
            $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        } catch (PDOException $e) {
            throw new Klarna_DatabaseException('Failed to connect to database!');
        }
    }
protected function getConnection($uri)
    {
        if ($this->pdo) {
            return; //Already have a connection
        }

        $this->splitURI($uri);

        try {
            $this->pdo = new PDO($this->dsn, $this->user, $this->passwd);
            $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        } catch (PDOException $e) {
            throw new Klarna_DatabaseException('Failed to connect to database!');
        }
    }
protected function getConnection ( $ uri ) { if ( $ this -> pdo ) { return ; //Already have a connection } $ this -> splitURI ( $ uri ) ; try { $ this -> pdo = new PDO ( $ this -> dsn , $ this -> user , $ this -> passwd ) ; $ this -> pdo -> setAttribute ( PDO :: ATTR_ERRMODE , PDO :: ERRMODE_EXCEPTION ) ; } catch ( PDOException $ e ) { throw new Klarna_DatabaseException ( 'Failed to connect to database!' ) ; } }
Connects to the DB.

@param string|array $uri pclass uri

@throws Klarna_DatabaseException If connection could not be established.

@deprecated Use the connect method instead.

@return void
Connects to the DB .