This commit is contained in:
2024-04-02 15:33:00 +02:00
parent f13ab7f9e0
commit a7dc4c0d2f
8 changed files with 132 additions and 13 deletions

View File

@@ -44,4 +44,14 @@ class Group extends DatabaseEntity {
new Group(Group::SUPPORT, Group::GROUPS[Group::SUPPORT], "#007bff"),
];
}
public function delete(SQL $sql): bool {
if (parent::delete($sql)) {
$handler = User::getHandler($sql);
$table = $handler->getNMRelation("groups")->getTableName();
return $sql->delete($table)->whereEq("group_id", $this->id)->execute();
} else {
return false;
}
}
}