Skip to content

Commit

Permalink
Fix upsert() not exiting earlier for a failed update
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Jun 18, 2014
1 parent 4b3a481 commit b482808
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Titon/Db/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,9 @@ public function upsert($data, $id = null, array $options = []) {

// Either update
if ($update) {
$this->update($id, $data, $options);
if (!$this->update($id, $data, $options)) {
return 0;
}

// Or insert
} else {
Expand Down

0 comments on commit b482808

Please sign in to comment.