/** * Marks the thread as undeleted by the current authenticated user * * @param ThreadInterface $thread */ public function markAsUndeleted(ThreadInterface $thread) { if (!$this->authorizer->canDeleteThread($thread)) { throw new AccessDeniedException('You are not allowed to delete this thread'); } $thread->setIsDeletedByParticipant($this->getAuthenticatedParticipant(), false); $this->dispatcher->dispatch(FOSMessageEvents::POST_UNDELETE, new ThreadEvent($thread)); }