You are here

protected function AccessTokenRouteProvider::getDeleteRoute in Access unpublished 8

1 call to AccessTokenRouteProvider::getDeleteRoute()
AccessTokenRouteProvider::getRoutes in src/Routing/AccessTokenRouteProvider.php
Provides routes for entities.

File

src/Routing/AccessTokenRouteProvider.php, line 58

Class

AccessTokenRouteProvider
Contains routs for access tokens.

Namespace

Drupal\access_unpublished\Routing

Code

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