Allow statically call beginTransaction, rollback and commit methods.

This commit is contained in:
kj
2025-07-15 18:12:41 -03:00
parent e9126e7cde
commit b2cb8d6883

View File

@ -72,7 +72,7 @@ class Model {
* *
* @return bool * @return bool
*/ */
public function beginTransaction(): bool public static function beginTransaction(): bool
{ {
return static::db()->beginTransaction(); return static::db()->beginTransaction();
} }
@ -83,7 +83,7 @@ class Model {
* *
* @return bool * @return bool
*/ */
public function rollBack(): bool public static function rollBack(): bool
{ {
if ( static::db()->inTransaction()) if ( static::db()->inTransaction())
return static::db()->rollBack(); return static::db()->rollBack();
@ -97,7 +97,7 @@ class Model {
* *
* @return bool * @return bool
*/ */
public function commit(): bool public static function commit(): bool
{ {
if (static::db()->inTransaction()) if (static::db()->inTransaction())
return static::db()->commit(); return static::db()->commit();