aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/event
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-01-07 21:42:19 +0100
committerIgor Wiedler <igor@wiedler.ch>2012-01-07 21:42:19 +0100
commit03be9761375a082c2a43aceaa1b34661f87d702b (patch)
treec6dce9e83f0cec85f977f3b32b6c276f80f2985f /phpBB/includes/event
parent58a99c97cadd6a16b138e4de4f8fd1aa172e4eed (diff)
downloadforums-03be9761375a082c2a43aceaa1b34661f87d702b.tar
forums-03be9761375a082c2a43aceaa1b34661f87d702b.tar.gz
forums-03be9761375a082c2a43aceaa1b34661f87d702b.tar.bz2
forums-03be9761375a082c2a43aceaa1b34661f87d702b.tar.xz
forums-03be9761375a082c2a43aceaa1b34661f87d702b.zip
[feature/event-dispatcher] Support setting data on an event
PHPBB3-9550
Diffstat (limited to 'phpBB/includes/event')
-rw-r--r--phpBB/includes/event/data.php56
1 files changed, 56 insertions, 0 deletions
diff --git a/phpBB/includes/event/data.php b/phpBB/includes/event/data.php
new file mode 100644
index 0000000000..754876c119
--- /dev/null
+++ b/phpBB/includes/event/data.php
@@ -0,0 +1,56 @@
+<?php
+/**
+*
+* @package phpBB3
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @ignore
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+class phpbb_event_data extends phpbb_event implements ArrayAccess
+{
+ private $data;
+
+ public function __construct(array $data = array())
+ {
+ $this->set_data($data);
+ }
+
+ public function set_data(array $data = array())
+ {
+ $this->data = $data;
+ }
+
+ public function get_data()
+ {
+ return $this->data;
+ }
+
+ public function offsetExists($offset)
+ {
+ return isset($this->data[$offset]);
+ }
+
+ public function offsetGet($offset)
+ {
+ return isset($this->data[$offset]) ? $this->data[$offset] : null;
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ $this->data[$offset] = $value;
+ }
+
+ public function offsetUnset($offset)
+ {
+ unset($this->data[$offset]);
+ }
+}