/** * Creates a new post report and stores it into the database. * * @param FrontendUser $user * @param ReportComment $firstComment */ public function createUserReportAction(FrontendUser $user, ReportComment $firstComment = NULL) { /** @var UserReport $report */ $report = $this->reportFactory->createUserReport($firstComment); $report->setUser($user); $this->userReportRepository->add($report); // Notify observers. $this->signalSlotDispatcher->dispatch('Mittwald\\Typo3Forum\\Domain\\Model\\Moderation\\Report', 'reportCreated', ['report' => $report]); // Display success message and redirect to topic->show action. $this->controllerContext->getFlashMessageQueue()->enqueue(new FlashMessage(LocalizationUtility::translate('Report_New_Success', 'Typo3Forum'))); $this->redirect('show', 'User', NULL, array('user' => $user), $this->settings['pids']['UserShow']); }
/** * @return void */ public function indexReportAction() { $this->view->assign('postReports', $this->postReportRepository->findAll()); $this->view->assign('userReports', $this->userReportRepository->findAll()); }