predefined entities + override database entity handler

This commit is contained in:
2023-01-09 17:09:57 +01:00
parent cee54a1946
commit 5ac363d360
5 changed files with 41 additions and 9 deletions

View File

@@ -36,4 +36,12 @@ class Group extends DatabaseEntity {
return User::toJsonArray($users, ["id", "name", "fullName", "profilePicture"]);
}
public static function getPredefinedValues(SQL $sql): array {
return [
new Group(Group::ADMIN, Group::GROUPS[Group::ADMIN], "#dc3545"),
new Group(Group::MODERATOR, Group::GROUPS[Group::MODERATOR], "#28a745"),
new Group(Group::SUPPORT, Group::GROUPS[Group::SUPPORT], "#007bff"),
];
}
}