diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-11-29 11:03:15 +0100 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-11-29 11:03:15 +0100 |
commit | fa9096c0ab521aae45cab6c48a54290d14a221b9 (patch) | |
tree | 61466b792c2714848cfea00594456ac06c259c94 /src/Model/Event.php | |
parent | 3afcaef927391db23fe23c6c8c26b8960e8dae32 (diff) |
event tables
Diffstat (limited to 'src/Model/Event.php')
-rw-r--r-- | src/Model/Event.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Model/Event.php b/src/Model/Event.php index b4c131e..de6c82e 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -8,15 +8,20 @@ class Event { public int $id; - public string $type; + public ?string $type; public \DateTime $time; - public string $payload; + public ?string $payload; public int $villageId; public \DateTime $createdAt; public \DateTime $updatedAt; + public function __construct(?\DateTime $time = null, int $villageId = 0) + { + $this->time = $time ?? new \DateTime(); + $this->villageId = $villageId; + } /* OOP */ |