From 60251cd62367aa8b50e7f717479eea5170b03e98 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Sun, 20 Nov 2016 19:06:23 +0100 Subject: [PATCH] [ticket/14557] Simplify updating overloaded events for extensions PHPBB3-14557 --- phpBB/phpbb/event/data.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/phpBB/phpbb/event/data.php b/phpBB/phpbb/event/data.php index c7365aee35..42080e96d5 100644 --- a/phpBB/phpbb/event/data.php +++ b/phpBB/phpbb/event/data.php @@ -63,4 +63,17 @@ class data extends Event implements \ArrayAccess { unset($this->data[$offset]); } + + /** + * Returns data with updated key in specified offset. + * + * @param string $offset Data array offset + * @param string $key Offset key + * @param mixed $value Value to update + * @return mixed Value of $value + */ + public function update_subarray($offset, $key, $value) + { + return $this->data[$offset][$key] = $value; + } }