mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 22:04:25 +02:00
Add method set/getByRef to Icinga\Web\Session\SessionNamespace
This commit is contained in:
parent
80c42ce499
commit
efab6c7827
@ -126,6 +126,17 @@ class SessionNamespace implements IteratorAggregate
|
|||||||
return $this;
|
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
|
* Getter for session values
|
||||||
*
|
*
|
||||||
@ -139,6 +150,16 @@ class SessionNamespace implements IteratorAggregate
|
|||||||
return isset($this->values[$key]) ? $this->values[$key] : $default;
|
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
|
* Delete the given value from the session
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user