diff --git a/DB.php b/DB.php index 5b39eba..b00a3af 100755 --- a/DB.php +++ b/DB.php @@ -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