chore: Мелкие правки

This commit is contained in:
origami11@yandex.ru 2025-11-28 17:44:08 +03:00
parent 3e0b99c3d2
commit 6fdc3eb46b
2 changed files with 7 additions and 2 deletions

View file

@ -206,8 +206,10 @@ class Component
/** /**
* Создает модель * Создает модель
* @param class-string $modelName *
* @return mixed * @template T
* @param class-string<T> $modelName
* @return T
*/ */
public function getModel($modelName) public function getModel($modelName)
{ {

View file

@ -35,6 +35,9 @@ class IdGenerator {
} else { } else {
$result = $this->db->fetchOneArray("SELECT last_insert_rowid() AS nextval"); $result = $this->db->fetchOneArray("SELECT last_insert_rowid() AS nextval");
} }
if (!$result) {
throw new \Exception("nextval failed");
}
return (int)$result['nextval']; return (int)$result['nextval'];
} }
} }