wsClientId = $ws_client_id; $this->type = WsTypeEnum::from($type); $this->event = WsEventEnum::from($event); $this->data = $data; } public function get($name, $default = null) { return $this->data[$name] ?? $default; } public function login(int $user_id, string $user_type, array $user_client = []): bool { if (empty($user_id) || empty($user_type) || count($user_client) == 0) { return false; } $this->userId = $user_id; $this->userType = $user_type; $this->userClient = $user_client; return true; } public function getClientId(): string { return $this->userClient['id'] ?? ''; } public function getClientName() { return $this->userClient['name'] ?? ''; } public function getClientVersion() { return $this->userClient['version'] ?? ''; } }