/** * Persist the contents of the current stack to the session, as well as the database. */ private function persist() { $items = $this->persistableList(); $this->session->set('stack', $items); $user = $this->users->getCurrentUser(); $user['stack'] = $items; $this->users->saveUser($user); }