mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
mapping lastNumRows to lastAffectedRows as it is not possible to do the first one using PDO
This commit is contained in:
parent
5a881c461e
commit
a335891eba
1 changed files with 2 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue