/** * Set metadata * * @param mixed $key Data key * @param mixed $value Data value * * @return $this */ public function setMetadata($key, $value) { $data = $this->metadata->getValue(); $metadata = $this->encoder->decode($data); $metadata[$key] = $value; $data = $this->encoder->encode($metadata); $this->metadata->setValue($data); return $this; }
/** * Decode user value stored in session * * @param mixed $user User data * * @return mixed */ protected function wakeupUser($user) { $user = $this->encoder->decode($user); return $user; }