Commit d4bc0d36 authored by subzero2000's avatar subzero2000

Ensure usage of Doctrine_Connection_Statement rather than PDOStatement in...

Ensure usage of Doctrine_Connection_Statement rather than PDOStatement in Doctrine_Connection::execute(). Fixes #365
parent 031b2ba7
...@@ -758,7 +758,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun ...@@ -758,7 +758,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
try { try {
if ( ! empty($params)) { if ( ! empty($params)) {
$stmt = $this->dbh->prepare($query); $stmt = $this->prepare($query);
$stmt->execute($params); $stmt->execute($params);
return $stmt; return $stmt;
} else { } else {
......
...@@ -213,8 +213,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf ...@@ -213,8 +213,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
*/ */
public function execute($params = null) public function execute($params = null)
{ {
$event = new Doctrine_Event($this, Doctrine_Event::STMT_EXECUTE, $this->_stmt->queryString, $params); $event = new Doctrine_Event($this, Doctrine_Event::STMT_EXECUTE, $this->getQuery(), $params);
// print $this->_stmt->queryString . print_r($params, true) . "<br>";
$this->_conn->getListener()->preExecute($event); $this->_conn->getListener()->preExecute($event);
if ( ! $event->skipOperation) { if ( ! $event->skipOperation) {
...@@ -257,7 +256,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf ...@@ -257,7 +256,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
$cursorOrientation = Doctrine::FETCH_ORI_NEXT, $cursorOrientation = Doctrine::FETCH_ORI_NEXT,
$cursorOffset = null) $cursorOffset = null)
{ {
$event = new Doctrine_Event($this, Doctrine_Event::STMT_FETCH, $this->_stmt->getQuery()); $event = new Doctrine_Event($this, Doctrine_Event::STMT_FETCH, $this->getQuery());
$event->fetchMode = $fetchMode; $event->fetchMode = $fetchMode;
$event->cursorOrientation = $cursorOrientation; $event->cursorOrientation = $cursorOrientation;
...@@ -289,7 +288,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf ...@@ -289,7 +288,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
public function fetchAll($fetchMode = Doctrine::FETCH_BOTH, public function fetchAll($fetchMode = Doctrine::FETCH_BOTH,
$columnIndex = null) $columnIndex = null)
{ {
$event = new Doctrine_Event($this, Doctrine_Event::STMT_FETCHALL, $this->_stmt->getQuery()); $event = new Doctrine_Event($this, Doctrine_Event::STMT_FETCHALL, $this->getQuery());
$event->fetchMode = $fetchMode; $event->fetchMode = $fetchMode;
$event->columnIndex = $columnIndex; $event->columnIndex = $columnIndex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment