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
This commit is contained in:
Victor Westerlund 2026-02-12 15:25:49 +01:00
parent c858cd111a
commit 19e15c0b23

View file

@ -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;