File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -763,6 +763,41 @@ public function sql(): string
763763 return $ this ->sql ;
764764 }
765765
766+ /**
767+ * Start Transaction
768+ * @return mysqli
769+ */
770+ public static function beginTransaction ()
771+ {
772+ Connect::DB ()->begin_transaction ();
773+ return Connect::DB ();
774+ }
775+
776+
777+ // Same as @beginTransaction
778+ public static function transaction ()
779+ {
780+ return self ::beginTransaction ();
781+ }
782+
783+ /**
784+ * Commit transaction
785+ * @return void
786+ */
787+ public static function commit (): void
788+ {
789+ Connect::DB ()->commit ();
790+ }
791+
792+ /**
793+ * Rollback transaction
794+ * @return void
795+ */
796+ public static function rollback (): void
797+ {
798+ Connect::DB ()->rollback ();
799+ }
800+
766801 /**
767802 * Get return a new generated UUID
768803 * DEPRECATED: Will be moved to Connect for starter
You can’t perform that action at this time.
0 commit comments