diff --git a/src/Transaction.php b/src/Transaction.php index e26be0cfa..9d3d1bfcb 100644 --- a/src/Transaction.php +++ b/src/Transaction.php @@ -199,11 +199,12 @@ public function run($query, $throw = true, $log = false, $commit = false){ if(!$this->clientSession->getInTransaction()) $this->start(); $this->clientSession->db->setSession($this->clientSession); - if($query()) { - if($commit) { - return $this->safeCommit(); + if($output = $query()) + { + if($commit){ + return $this->safeCommit() ? $output : false; } - return true; + return $output; } return false; }