/** * Initialize session bag * * @throws Exception * @throws \Rad\DependencyInjection\Exception\ServiceNotFoundException */ public function initialize() { if (false === $this->initialized) { if (!$this->container) { throw new Exception('A container object is required to access the \'session\' service.'); } $this->session = $this->container->get('session'); $this->data = $this->session->get($this->name, []); $this->initialized = true; } }
/** * {@inheritdoc} */ public function read() { return $this->session->get($this->namespace); }