From c481a67800cae545b0e6f250724b96acf4806437 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/NullEmployee.php | 8 ++++++++ Models/NullEmployeeEducationHistory.php | 8 ++++++++ Models/NullEmployeeHistory.php | 8 ++++++++ Models/NullEmployeeWorkHistory.php | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/Models/NullEmployee.php b/Models/NullEmployee.php index 331505e..f56415a 100755 --- a/Models/NullEmployee.php +++ b/Models/NullEmployee.php @@ -36,4 +36,12 @@ final class NullEmployee extends Employee $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullEmployeeEducationHistory.php b/Models/NullEmployeeEducationHistory.php index bbc363a..61af77e 100755 --- a/Models/NullEmployeeEducationHistory.php +++ b/Models/NullEmployeeEducationHistory.php @@ -36,4 +36,12 @@ final class NullEmployeeEducationHistory extends EmployeeEducationHistory $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullEmployeeHistory.php b/Models/NullEmployeeHistory.php index a5911a3..551a7f5 100755 --- a/Models/NullEmployeeHistory.php +++ b/Models/NullEmployeeHistory.php @@ -36,4 +36,12 @@ final class NullEmployeeHistory extends EmployeeHistory $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } } diff --git a/Models/NullEmployeeWorkHistory.php b/Models/NullEmployeeWorkHistory.php index 5698095..f25b862 100755 --- a/Models/NullEmployeeWorkHistory.php +++ b/Models/NullEmployeeWorkHistory.php @@ -36,4 +36,12 @@ final class NullEmployeeWorkHistory extends EmployeeWorkHistory $this->id = $id; parent::__construct(); } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } }