From 97d8ee000135ad7f3d96e2374e16ccb7452b4a18 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 9 Nov 2022 23:02:52 +0100 Subject: [PATCH] reduce serialization of null models --- Models/NullCalendar.php | 8 ++++++++ Models/NullEvent.php | 8 ++++++++ Models/NullSchedule.php | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/Models/NullCalendar.php b/Models/NullCalendar.php index d4e9dbd..355e476 100755 --- a/Models/NullCalendar.php +++ b/Models/NullCalendar.php @@ -36,4 +36,12 @@ final class NullCalendar extends Calendar $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullEvent.php b/Models/NullEvent.php index 664afc6..993abc0 100755 --- a/Models/NullEvent.php +++ b/Models/NullEvent.php @@ -36,4 +36,12 @@ final class NullEvent extends Event $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullSchedule.php b/Models/NullSchedule.php index faec684..0c139d9 100755 --- a/Models/NullSchedule.php +++ b/Models/NullSchedule.php @@ -36,4 +36,12 @@ final class NullSchedule extends Schedule $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } }