chore: Мелкие правки
This commit is contained in:
parent
3e0b99c3d2
commit
6fdc3eb46b
2 changed files with 7 additions and 2 deletions
|
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue