diff --git a/library/Icinga/Web/Session/SessionNamespace.php b/library/Icinga/Web/Session/SessionNamespace.php index b7495683b..fec3c5dca 100644 --- a/library/Icinga/Web/Session/SessionNamespace.php +++ b/library/Icinga/Web/Session/SessionNamespace.php @@ -126,6 +126,17 @@ class SessionNamespace implements IteratorAggregate return $this; } + public function setByRef($key, &$value) + { + $this->values[$key] = $value; + + if (in_array($key, $this->removed)) { + unset($this->removed[array_search($key, $this->removed)]); + } + + return $this; + } + /** * Getter for session values * @@ -139,6 +150,16 @@ class SessionNamespace implements IteratorAggregate return isset($this->values[$key]) ? $this->values[$key] : $default; } + public function & getByRef($key, $default = null) + { + $value = $default; + if (isset($this->values[$key])) { + $value = & $this->values[$key]; + } + + return $value; + } + /** * Delete the given value from the session *