From eb1a96b0b6a892457ee81d7ff20f58900b312966 Mon Sep 17 00:00:00 2001 From: zYne Date: Sat, 30 Dec 2006 00:28:24 +0000 Subject: [PATCH] Changed the PDO::query calls to Doctrine_Connection::execute calls for portable errors --- lib/Doctrine/Transaction/Firebird.php | 8 ++++---- lib/Doctrine/Transaction/Mssql.php | 2 +- lib/Doctrine/Transaction/Mysql.php | 10 +++++----- lib/Doctrine/Transaction/Oracle.php | 6 +++--- lib/Doctrine/Transaction/Pgsql.php | 8 ++++---- lib/Doctrine/Transaction/Sqlite.php | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/Doctrine/Transaction/Firebird.php b/lib/Doctrine/Transaction/Firebird.php index cfb741c56..bf0151b30 100644 --- a/lib/Doctrine/Transaction/Firebird.php +++ b/lib/Doctrine/Transaction/Firebird.php @@ -43,7 +43,7 @@ class Doctrine_Transaction_Firebird extends Doctrine_Transaction { $query = 'SAVEPOINT '.$savepoint; - return $this->conn->getDbh()->query($query); + return $this->conn->execute($query); } /** * releaseSavePoint @@ -56,7 +56,7 @@ class Doctrine_Transaction_Firebird extends Doctrine_Transaction { $query = 'RELEASE SAVEPOINT '.$savepoint; - return $this->conn->getDbh()->query($query); + return $this->conn->execute($query); } /** * rollbackSavePoint @@ -69,7 +69,7 @@ class Doctrine_Transaction_Firebird extends Doctrine_Transaction { $query = 'ROLLBACK TO SAVEPOINT '.$savepoint; - return $this->conn->getDbh()->query($query); + return $this->conn->execute($query); } /** * Set the transacton isolation level. @@ -132,6 +132,6 @@ class Doctrine_Transaction_Firebird extends Doctrine_Transaction $query = 'SET TRANSACTION' . $rw . $wait .' ISOLATION LEVEL ' . $nativeIsolation; - $this->conn->getDbh()->query($query); + $this->conn->execute($query); } } diff --git a/lib/Doctrine/Transaction/Mssql.php b/lib/Doctrine/Transaction/Mssql.php index 6ee46dc5e..f0e32113b 100644 --- a/lib/Doctrine/Transaction/Mssql.php +++ b/lib/Doctrine/Transaction/Mssql.php @@ -63,6 +63,6 @@ class Doctrine_Transaction_Mssql extends Doctrine_Transaction $query = 'SET TRANSACTION ISOLATION LEVEL ' . $isolation; - $this->conn->getDbh()->query($query); + $this->conn->execute($query); } } diff --git a/lib/Doctrine/Transaction/Mysql.php b/lib/Doctrine/Transaction/Mysql.php index e0cec49f1..15ea269bf 100644 --- a/lib/Doctrine/Transaction/Mysql.php +++ b/lib/Doctrine/Transaction/Mysql.php @@ -43,7 +43,7 @@ class Doctrine_Transaction_Mysql extends Doctrine_Transaction { $query = 'SAVEPOINT '.$savepoint; - return $this->conn->getDbh()->query($query); + return $this->conn->execute($query); } /** * releaseSavePoint @@ -56,7 +56,7 @@ class Doctrine_Transaction_Mysql extends Doctrine_Transaction { $query = 'RELEASE SAVEPOINT '.$savepoint; - return $this->conn->getDbh()->query($query); + return $this->conn->execute($query); } /** * rollbackSavePoint @@ -69,7 +69,7 @@ class Doctrine_Transaction_Mysql extends Doctrine_Transaction { $query = 'ROLLBACK TO SAVEPOINT '.$savepoint; - return $this->conn->getDbh()->query($query); + return $this->conn->execute($query); } /** * Set the transacton isolation level. @@ -98,7 +98,7 @@ class Doctrine_Transaction_Mysql extends Doctrine_Transaction $query = 'SET SESSION TRANSACTION ISOLATION LEVEL ' . $isolation; - return $this->conn->getDbh()->query($query); + return $this->conn->execute($query); } /** * getTransactionIsolation @@ -107,7 +107,7 @@ class Doctrine_Transaction_Mysql extends Doctrine_Transaction */ public function getIsolation() { - $ret = $this->conn->getDbh()->query('SELECT @@tx_isolation')->fetch(PDO::FETCH_NUM); + $ret = $this->conn->execute('SELECT @@tx_isolation')->fetch(PDO::FETCH_NUM); return current($ret); } } diff --git a/lib/Doctrine/Transaction/Oracle.php b/lib/Doctrine/Transaction/Oracle.php index 164f7a3b6..79adf019c 100644 --- a/lib/Doctrine/Transaction/Oracle.php +++ b/lib/Doctrine/Transaction/Oracle.php @@ -43,7 +43,7 @@ class Doctrine_Transaction_Oracle extends Doctrine_Transaction { $query = 'SAVEPOINT '.$savepoint; - return $this->conn->getDbh()->query($query); + return $this->conn->execute($query); } /** * releaseSavePoint @@ -68,7 +68,7 @@ class Doctrine_Transaction_Oracle extends Doctrine_Transaction { $query = 'ROLLBACK TO SAVEPOINT '.$savepoint; - return $this->conn->getDbh()->query($query); + return $this->conn->execute($query); } /** * Set the transacton isolation level. @@ -98,6 +98,6 @@ class Doctrine_Transaction_Oracle extends Doctrine_Transaction } $query = 'ALTER SESSION ISOLATION LEVEL ' . $isolation; - return $this->conn->getDbh()->query($query); + return $this->conn->execute($query); } } diff --git a/lib/Doctrine/Transaction/Pgsql.php b/lib/Doctrine/Transaction/Pgsql.php index 4c8147740..22700dfaa 100644 --- a/lib/Doctrine/Transaction/Pgsql.php +++ b/lib/Doctrine/Transaction/Pgsql.php @@ -44,7 +44,7 @@ class Doctrine_Transaction_Pgsql extends Doctrine_Transaction { $query = 'SAVEPOINT '.$savepoint; - return $this->conn->getDbh()->query($query); + return $this->conn->execute($query); } /** * releaseSavePoint @@ -57,7 +57,7 @@ class Doctrine_Transaction_Pgsql extends Doctrine_Transaction { $query = 'RELEASE SAVEPOINT '.$savepoint; - return $this->conn->getDbh()->query($query); + return $this->conn->execute($query); } /** * rollbackSavePoint @@ -70,7 +70,7 @@ class Doctrine_Transaction_Pgsql extends Doctrine_Transaction { $query = 'ROLLBACK TO SAVEPOINT '.$savepoint; - return $this->conn->getDbh()->query($query); + return $this->conn->execute($query); } /** * Set the transacton isolation level. @@ -97,6 +97,6 @@ class Doctrine_Transaction_Pgsql extends Doctrine_Transaction } $query = 'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL ' . $isolation; - return $this->conn->getDbh()->query($query); + return $this->conn->execute($query); } } diff --git a/lib/Doctrine/Transaction/Sqlite.php b/lib/Doctrine/Transaction/Sqlite.php index ba67706f9..39137abf1 100644 --- a/lib/Doctrine/Transaction/Sqlite.php +++ b/lib/Doctrine/Transaction/Sqlite.php @@ -61,6 +61,6 @@ class Doctrine_Transaction_Sqlite extends Doctrine_Transaction $query = 'PRAGMA read_uncommitted = '.$isolation; - return $this->conn->getDbh()->query($query); + return $this->conn->execute($query); } }