"Administrator", self::MODERATOR => "Moderator", self::SUPPORT => "Support", ]; #[MaxLength(32)] public string $name; #[MaxLength(10)] public string $color; public function __construct(?int $id, string $name, string $color) { parent::__construct($id); $this->name = $name; $this->color = $color; } public function jsonSerialize(): array { return [ "id" => $this->getId(), "name" => $this->name, "color" => $this->color ]; } public function getMembers(SQL $sql): array { $nmTable = NMRelation::buildTableName(User::class, Group::class); return User::findBy(User::createBuilder($sql, false) ->innerJoin($nmTable, "user_id", "User.id") ->whereEq("group_id", $this->id)); } }