From 4ff6164651faeefa2cbd21df4a21f9b98c64ebe6 Mon Sep 17 00:00:00 2001 From: zYne Date: Tue, 6 Feb 2007 20:49:28 +0000 Subject: [PATCH] --- lib/Doctrine/Db/Statement.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/Db/Statement.php b/lib/Doctrine/Db/Statement.php index e50aa2cf5..164825a7a 100644 --- a/lib/Doctrine/Db/Statement.php +++ b/lib/Doctrine/Db/Statement.php @@ -235,7 +235,18 @@ class Doctrine_Db_Statement implements Doctrine_Adapter_Statement_Interface $cursorOrientation = Doctrine::FETCH_ORI_NEXT, $cursorOffset = null) { - return $this->stmt->fetch($fetchStyle, $cursorOrientation, $cursorOffset); + $event = new Doctrine_Db_Event($this, Doctrine_Db_Event::FETCHALL, $this->stmt->queryString, + array($fetchStyle, $cursorOrientation, $cursorOffset)); + + $data = $this->adapter->getListener()->onPreFetch($event); + + if ($data === null) { + $data = $this->stmt->fetch($fetchStyle, $cursorOrientation, $cursorOffset); + } + + $this->adapter->getListener()->onFetch($event); + + return $data; } /** * fetchAll