diff --git a/src/Record.php b/src/Record.php index dbb2132..eaf5ce2 100644 --- a/src/Record.php +++ b/src/Record.php @@ -204,15 +204,15 @@ public static function start(): static|null { $args = func_get_args(); $class = get_called_class(); - if (Db::hasDb($class)) { - Db::db($class)->beginTransaction(); - } if ($class !== 'Pop\Db\Record') { $record = (!empty($args)) ? (new \ReflectionClass($class))->newInstanceArgs($args) : new static(); $record->startTransaction(); return $record; } else { + if (Db::hasDb($class)) { + Db::db($class)->beginTransaction(); + } return null; } }