You are here

protected function DataPolicyHtmlRouteProvider::getRevisionRoute in Data Policy 8

Gets the revision 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 DataPolicyHtmlRouteProvider::getRevisionRoute()
DataPolicyHtmlRouteProvider::getRoutes in src/DataPolicyHtmlRouteProvider.php
Provides routes for entities.

File

src/DataPolicyHtmlRouteProvider.php, line 88

Class

DataPolicyHtmlRouteProvider
Provides routes for Data policy entities.

Namespace

Drupal\data_policy

Code

protected function getRevisionRoute(EntityTypeInterface $entity_type) {
  if ($entity_type
    ->hasLinkTemplate('revision')) {
    $route = new Route($entity_type
      ->getLinkTemplate('revision'));
    $route
      ->setDefaults([
      '_controller' => '\\Drupal\\data_policy\\Controller\\DataPolicy::revisionOverviewPage',
      '_title_callback' => '\\Drupal\\data_policy\\Controller\\DataPolicy::revisionOverviewTitle',
    ])
      ->setRequirement('_permission', 'access data policy revisions')
      ->setOption('_admin_route', TRUE);
    return $route;
  }
}