You are here

protected function FlaggingCollectionHtmlRouteProvider::getRevisionRoute in Flag Lists 8

Same name and namespace in other branches
  1. 4.0.x src/FlaggingCollectionHtmlRouteProvider.php \Drupal\flag_lists\FlaggingCollectionHtmlRouteProvider::getRevisionRoute()

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

File

src/FlaggingCollectionHtmlRouteProvider.php, line 85

Class

FlaggingCollectionHtmlRouteProvider
Provides routes for Flagging collection entities.

Namespace

Drupal\flag_lists

Code

protected function getRevisionRoute(EntityTypeInterface $entity_type) {
  if ($entity_type
    ->hasLinkTemplate('revision')) {
    $route = new Route($entity_type
      ->getLinkTemplate('revision'));
    $route
      ->setDefaults([
      '_controller' => '\\Drupal\\flag_lists\\Controller\\FlaggingCollectionController::revisionShow',
      '_title_callback' => '\\Drupal\\flag_lists\\Controller\\FlaggingCollectionController::revisionPageTitle',
    ])
      ->setRequirement('_permission', 'access flagging collection revisions')
      ->setOption('_admin_route', TRUE);
    return $route;
  }
}