reportingService = $reportingService; } public static function getActionName(): string { return 'reporting'; } public function onActions(PageActionsEvent $event): void { $reports = $this->reportingService->getAvailableReports($event->getUser()); foreach ($reports as $report) { $subMenu = 'reporting'; if ($report instanceof Report) { $subMenu = $report->getReportIcon(); } $event->addActionToSubmenu($subMenu, $report->getId(), ['title' => $report->getLabel(), 'translation_domain' => 'reporting', 'url' => $this->path($report->getRoute()), 'class' => 'report-' . $report->getId()]); } $event->addHelp($this->documentationLink('reporting.html')); } }