Skip to content

Commit

Permalink
Transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Wazabii committed Dec 5, 2023
1 parent 1e207c7 commit 55a280a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,41 @@ public function sql(): string
return $this->sql;
}

/**
* Start Transaction
* @return mysqli
*/
public static function beginTransaction()
{
Connect::DB()->begin_transaction();
return Connect::DB();
}


// Same as @beginTransaction
public static function transaction()
{
return self::beginTransaction();
}

/**
* Commit transaction
* @return void
*/
public static function commit(): void
{
Connect::DB()->commit();
}

/**
* Rollback transaction
* @return void
*/
public static function rollback(): void
{
Connect::DB()->rollback();
}

/**
* Get return a new generated UUID
* DEPRECATED: Will be moved to Connect for starter
Expand Down

0 comments on commit 55a280a

Please sign in to comment.