From 174739ad1703aa8b7999b7ff8c4444c5641e98d2 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Sat, 2 May 2020 21:11:55 +0200 Subject: [PATCH] fixes --- lib/ControlModel.ts | 14 ++++++++++++-- lib/DatabaseModel.ts | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/ControlModel.ts b/lib/ControlModel.ts index f9d97c3..fb3c57b 100644 --- a/lib/ControlModel.ts +++ b/lib/ControlModel.ts @@ -6,8 +6,18 @@ */ export abstract class ControlModel { - public abstract get object(): Record; - public abstract set object(obj: Record); + protected data: Record; + + public abstract get object(): Record; + public abstract set object(obj: Record); + + public get (key: string): string|number|boolean { + return data[key]; + } + + public set (key: string, value: string|number|boolean): void { + this.data[key] = value; + } public update (): void { this.verify (); diff --git a/lib/DatabaseModel.ts b/lib/DatabaseModel.ts index 9f29462..6a910a6 100644 --- a/lib/DatabaseModel.ts +++ b/lib/DatabaseModel.ts @@ -16,7 +16,7 @@ export abstract class DatabaseModel { this.data.id = val; } - public get data (): Record { + public get object (): Record { return this.data; }