Skip to content

Commit

Permalink
Add extra methods for adding and removing individual ExtraData items
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewis-everley committed Oct 30, 2024
1 parent eb517a6 commit 1dfa95a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Traits/ExtraData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 1dfa95a

Please sign in to comment.