Skip to content

Commit

Permalink
Remove assignment in conditional.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Oct 31, 2013
1 parent f4e1414 commit 776fcad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Cake/Database/Statement/StatementDecorator.php
Expand Up @@ -272,7 +272,11 @@ public function bind($params, $types) {
* @return string
*/
public function lastInsertId($table = null, $column = null) {
if ($column && $row = $this->fetch('assoc')) {
$row = null;
if ($column) {
$row = $this->fetch('assoc');
}
if ($column && $row) {
return $row[$column];
}
return $this->_driver->lastInsertId($table, $column);
Expand Down

0 comments on commit 776fcad

Please sign in to comment.