protected function InvoiceHtmlRouteProvider::getHistoryRoute in Drupal PM (Project Management) 4.x
Gets the version history route.
Parameters
\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.
Return value
\Symfony\Component\Routing\Route|null The generated route, if available.
1 call to InvoiceHtmlRouteProvider::getHistoryRoute()
- InvoiceHtmlRouteProvider::getRoutes in modules/
pm_invoice/ src/ InvoiceHtmlRouteProvider.php - Provides routes for entities.
File
- modules/
pm_invoice/ src/ InvoiceHtmlRouteProvider.php, line 57
Class
- InvoiceHtmlRouteProvider
- Provides routes for Invoice entities.
Namespace
Drupal\pm_invoiceCode
protected function getHistoryRoute(EntityTypeInterface $entity_type) {
if ($entity_type
->hasLinkTemplate('version-history')) {
$route = new Route($entity_type
->getLinkTemplate('version-history'));
$route
->setDefaults([
'_title' => "{$entity_type->getLabel()} revisions",
'_controller' => '\\Drupal\\pm_invoice\\Controller\\InvoiceController::revisionOverview',
])
->setRequirement('_permission', 'view all invoice revisions')
->setOption('_admin_route', TRUE);
return $route;
}
}