addType('id', 'integer'); $this->addType('documentId', 'integer'); $this->addType('lastContact', 'integer'); } public function isGuest(): bool { return $this->userId === null; } public function getUserId(): string { if ($this->userId === null) { throw new InvalidSessionException('No user id found'); } return $this->userId; } public function jsonSerialize(): array { return [ 'id' => $this->id, 'userId' => $this->userId, 'token' => $this->token, 'color' => $this->color, 'lastAwarenessMessage' => $this->lastAwarenessMessage, 'lastContact' => $this->lastContact, 'guestName' => $this->guestName, 'documentId' => $this->documentId, ]; } }