. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Module; use Fisharebest\Webtrees\Individual; use Fisharebest\Webtrees\Menu; /** * Trait ModuleReportTrait - default implementation of ModuleReportInterface */ trait ModuleReportTrait { /** * @return string */ abstract public function name(): string; /** * @return string */ abstract public function title(): string; /** * Name of the XML report file, relative to the resources folder. * * @return string */ public function xmlFilename(): string { return 'xml/reports/' . $this->name() . '.xml'; } /** * Return a menu item for this report. * * @param Individual $individual * * @return Menu */ public function getReportMenu(Individual $individual): Menu { return new Menu( $this->title(), route('report-setup', [ 'xref' => $individual->xref(), 'tree' => $individual->tree()->name(), 'report' => $this->name(), ]), 'menu-report-' . $this->name(), ['rel' => 'nofollow'] ); } }