You are here

protected function DeveloperAppRouteProvider::getApiKeyRouteDeveloperApp in Apigee Edge 8

Gets the api key route for a developer app.

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

File

src/Entity/DeveloperAppRouteProvider.php, line 333

Class

DeveloperAppRouteProvider
Default entity routes for developer apps.

Namespace

Drupal\apigee_edge\Entity

Code

protected function getApiKeyRouteDeveloperApp(EntityTypeInterface $entity_type) {
  if ($entity_type
    ->hasLinkTemplate('api-keys')) {
    $route = new Route($entity_type
      ->getLinkTemplate('api-keys'));
    $route
      ->setDefault('_controller', DeveloperAppKeysController::class . '::developerAppKeys');
    $route
      ->setDefault('_title_callback', AppTitleProvider::class . '::title');
    $route
      ->setDefault('entity_type_id', $entity_type
      ->id());
    $this
      ->ensureUserParameter($route);
    $route
      ->setRequirement('_app_access_check_by_app_name', 'view');
    return $route;
  }
}