You are here

protected function AccessTokenRouteProvider::getRenewRoute in Access unpublished 8

Gets the add page route.

Built only for entity types that have bundles.

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

File

src/Routing/AccessTokenRouteProvider.php, line 44

Class

AccessTokenRouteProvider
Contains routs for access tokens.

Namespace

Drupal\access_unpublished\Routing

Code

protected function getRenewRoute(EntityTypeInterface $entity_type) {
  $entity_type_id = $entity_type
    ->id();
  $route = new Route($entity_type
    ->getLinkTemplate('renew'));
  $route
    ->setDefault('_controller', AccessTokenController::class . '::renew')
    ->setRequirement('_permission', 'renew token')
    ->setOption('parameters', [
    $entity_type_id => [
      'type' => 'entity:' . $entity_type_id,
    ],
  ]);
  return $route;
}