From a335891eba84e3576b4d6cf5c379bef38bcf4070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Tue, 16 Nov 2010 02:02:08 -0430 Subject: [PATCH] mapping lastNumRows to lastAffectedRows as it is not possible to do the first one using PDO --- cake/libs/model/datasources/dbo_source.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index e9f14e522..4eacfcfdc 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -299,8 +299,7 @@ class DboSource extends DataSource { if ($options['log']) { $this->took = round((microtime(true) - $t) * 1000, 0); - $this->affected = $this->lastAffected(); - //$this->numRows = $this->lastNumRows(); + $this->numRows = $this->affected = $this->lastAffected(); $this->logQuery($sql); } @@ -376,14 +375,7 @@ class DboSource extends DataSource { * @return integer Number of rows in resultset */ function lastNumRows($source = null) { - if ($this->hasResult()) { - $i = 0; - foreach ($this->_result as $row) { - $i++; - } - return $i; - } - return null; + return $this->lastAffected($source); } /**