コード例 #1
0
 /**
  * Creates a new post report and stores it into the database.
  *
  * @param Post $post
  * @param ReportComment $firstComment
  */
 public function createPostReportAction(Post $post, ReportComment $firstComment = NULL)
 {
     // Assert authorization;
     $this->authenticationService->assertReadAuthorization($post);
     /** @var PostReport $report */
     $report = $this->reportFactory->createPostReport($firstComment);
     $report->setPost($post);
     $this->postReportRepository->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', 'Topic', NULL, array('topic' => $post->getTopic()));
 }
コード例 #2
0
 /**
  * @return void
  */
 public function indexReportAction()
 {
     $this->view->assign('postReports', $this->postReportRepository->findAll());
     $this->view->assign('userReports', $this->userReportRepository->findAll());
 }