From 19e15c0b2358bdac49f86bedd1dc06ae5890b56d Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Thu, 12 Feb 2026 15:25:49 +0100 Subject: [PATCH] fix: allow int type for abstract `$id` property in `Database\Model` (#27) It's not guaranteed that the primary key ($id here) is a string. We primarily use UUIDs for the primary key, but it could also be an integer. Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/27 --- src/Database/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Database/Model.php b/src/Database/Model.php index df1def8..3ff76fe 100644 --- a/src/Database/Model.php +++ b/src/Database/Model.php @@ -13,7 +13,7 @@ public const DATE_FORMAT = Database::DATE_FORMAT; public const DATETIME_FORMAT = Database::DATETIME_FORMAT; - abstract public string $id { get; } + abstract public int|string $id { get; } protected readonly Database $db; private bool $_resolved = false;