service = $service; $this->eventDispatcher = $eventDispatcher; } public function setToken(string $token) { $this->token = $token; $this->room = null; } public function isValidToken(): bool { $room = $this->getRoom(); return $room !== null; } /** * @PublicPage * @NoCSRFRequired */ public function meetingEnded($recordingmarks = false) { $recordingmarks = \boolval($recordingmarks); $this->eventDispatcher->dispatch(RoomEndedEvent::class, new RoomEndedEvent($this->getRoom(), $recordingmarks)); } /** * @PublicPage * @NoCSRFRequired */ public function recordingReady() { $this->eventDispatcher->dispatch(RecordingReadyEvent::class, new RecordingReadyEvent($this->getRoom())); } private function getRoom(): ?Room { if ($this->room === null) { $this->room = $this->service->findByUid($this->token); } return $this->room; } }