1
0
mirror of synced 2025-03-19 22:43:58 +03:00

Ensure usage of Doctrine_Connection_Statement rather than PDOStatement in Doctrine_Connection::execute(). Fixes #365

This commit is contained in:
subzero2000 2007-06-26 22:29:31 +00:00
parent 031b2ba70c
commit d4bc0d3637
2 changed files with 4 additions and 5 deletions

View File

@ -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 {

View File

@ -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
$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
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;