/** * Set in bag * * @param string $key * @param mixed $value * * @throws Exception */ public function set($key, $value) { $this->initialize(); $ids = explode('.', $key); $base =& $this->data; while ($current = array_shift($ids)) { if (is_array($base) && array_key_exists($current, $base)) { $base =& $base[$current]; } else { $base[$current] = []; $base =& $base[$current]; } } $base = $value; $this->session->set($this->name, $this->data); }
/** * {@inheritdoc} */ public function write($data) { $this->session->set($this->namespace, $data); }