namespaces[$identifier])) { if (in_array($identifier, $this->removedNamespaces)) { unset($this->removedNamespaces[array_search($identifier, $this->removedNamespaces)]); } $this->namespaces[$identifier] = new SessionNamespace($this); } return $this->namespaces[$identifier]; } /** * Return whether the given session namespace exists * * @param string $identifier The namespace's identifier to check * * @return bool */ public function hasNamespace($identifier) { return isset($this->namespaces[$identifier]); } /** * Remove the given session namespace * * @param string $identifier The identifier of the namespace to remove */ public function removeNamespace($identifier) { unset($this->namespaces[$identifier]); $this->removedNamespaces[] = $identifier; } /** * Clear all values and namespaces from the session cache */ public function clear() { $this->values = array(); $this->removed = array(); $this->namespaces = array(); $this->removedNamespaces = array(); } }