Skip to content

Commit

Permalink
mapping lastNumRows to lastAffectedRows as it is not possible to do t…
Browse files Browse the repository at this point in the history
…he first one using PDO
  • Loading branch information
lorenzo committed Nov 16, 2010
1 parent 5a881c4 commit a335891
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions cake/libs/model/datasources/dbo_source.php
Expand Up @@ -299,8 +299,7 @@ public function execute($sql, $options = array(), $params = array()) {

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);
}

Expand Down Expand Up @@ -376,14 +375,7 @@ function lastAffected($source = null) {
* @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);
}

/**
Expand Down

0 comments on commit a335891

Please sign in to comment.