From 1dfa95a042f8741fd0ede6472510a89ed7d118d3 Mon Sep 17 00:00:00 2001 From: Morven Lewis-Everley Date: Wed, 30 Oct 2024 12:06:53 +0000 Subject: [PATCH] Add extra methods for adding and removing individual ExtraData items --- src/Traits/ExtraData.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Traits/ExtraData.php b/src/Traits/ExtraData.php index 71d4c11..b5285ee 100644 --- a/src/Traits/ExtraData.php +++ b/src/Traits/ExtraData.php @@ -25,4 +25,16 @@ public function setExtraData(array $data): self $this->extra_data = $data; return $this; } + + public function addExtraDataItem(string $key, mixed $value): self + { + $this->extra_data[$key] = $value; + return $this; + } + + public function removeExtraDataItem(string $key): self + { + unset($this->extra_data[$key]); + return $this; + } } \ No newline at end of file