topicName; } /** * Returns the content of the published message. */ public function getMessage(): string { return $this->message; } /** * Returns the requested quality of service level. */ public function getQualityOfServiceLevel(): int { return $this->qualityOfService; } /** * Determines whether this message wants to be retained. */ public function wantsToBeRetained(): bool { return $this->retain; } /** * Determines whether the message has been confirmed as received. */ public function hasBeenReceived(): bool { return $this->received; } /** * Marks the published message as received (QoS level 2). * * Returns `true` if the message was not previously received. Otherwise `false` will be returned. */ public function markAsReceived(): bool { $result = !$this->received; $this->received = true; return $result; } }