Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ziaratban committed Dec 19, 2024
1 parent 16cfd26 commit 991566e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 991566e

Please sign in to comment.