You are here

public function ContentReportService::getReportFlagTypes in Open Social 10.3.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_content_report/src/ContentReportService.php \Drupal\social_content_report\ContentReportService::getReportFlagTypes()
  2. 8.5 modules/social_features/social_content_report/src/ContentReportService.php \Drupal\social_content_report\ContentReportService::getReportFlagTypes()
  3. 8.6 modules/social_features/social_content_report/src/ContentReportService.php \Drupal\social_content_report\ContentReportService::getReportFlagTypes()
  4. 8.7 modules/social_features/social_content_report/src/ContentReportService.php \Drupal\social_content_report\ContentReportService::getReportFlagTypes()
  5. 8.8 modules/social_features/social_content_report/src/ContentReportService.php \Drupal\social_content_report\ContentReportService::getReportFlagTypes()
  6. 10.0.x modules/social_features/social_content_report/src/ContentReportService.php \Drupal\social_content_report\ContentReportService::getReportFlagTypes()
  7. 10.1.x modules/social_features/social_content_report/src/ContentReportService.php \Drupal\social_content_report\ContentReportService::getReportFlagTypes()
  8. 10.2.x modules/social_features/social_content_report/src/ContentReportService.php \Drupal\social_content_report\ContentReportService::getReportFlagTypes()

Gets all the 'report_' flag types.

This makes it more flexible so when new flags are added, it automatically gets them as well.

Return value

array List of flag type IDs that are used for reporting.

Overrides ContentReportServiceInterface::getReportFlagTypes

File

modules/social_features/social_content_report/src/ContentReportService.php, line 77

Class

ContentReportService
Provides a content report service.

Namespace

Drupal\social_content_report

Code

public function getReportFlagTypes() : array {
  $report_flags = $this->moduleHandler
    ->invokeAll('social_content_report_flags');

  // Allow using reports for three predefined entity types.
  $report_flags = array_merge($report_flags, [
    'report_comment',
    'report_node',
    'report_post',
  ]);
  $this->moduleHandler
    ->alter('social_content_report_flags', $report_flags);
  return $report_flags;
}