You are here

public function DeveloperAppRouteProvider::getRoutes in Apigee Edge 8

Provides routes for entities.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type

Return value

\Symfony\Component\Routing\RouteCollection|\Symfony\Component\Routing\Route[] Returns a route collection or an array of routes keyed by name, like route_callbacks inside 'routing.yml' files.

Overrides AppRouteProvider::getRoutes

File

src/Entity/DeveloperAppRouteProvider.php, line 42

Class

DeveloperAppRouteProvider
Default entity routes for developer apps.

Namespace

Drupal\apigee_edge\Entity

Code

public function getRoutes(EntityTypeInterface $entity_type) {
  $collection = parent::getRoutes($entity_type);
  $entity_type_id = $entity_type
    ->id();
  if ($collection_by_developer = $this
    ->getCollectionRouteByDeveloper($entity_type)) {
    $collection
      ->add("entity.{$entity_type_id}.collection_by_developer", $collection_by_developer);
  }
  if ($canonical_by_developer = $this
    ->getCanonicalRouteByDeveloper($entity_type)) {
    $collection
      ->add("entity.{$entity_type_id}.canonical_by_developer", $canonical_by_developer);
  }
  if ($add_form_for_developer = $this
    ->getAddFormRouteForDeveloper($entity_type)) {
    $collection
      ->add("entity.{$entity_type_id}.add_form_for_developer", $add_form_for_developer);
  }
  if ($edit_form_for_developer = $this
    ->getEditFormRouteForDeveloper($entity_type)) {
    $collection
      ->add("entity.{$entity_type_id}.edit_form_for_developer", $edit_form_for_developer);
  }
  if ($delete_form_for_developer = $this
    ->getDeleteFormRouteForDeveloper($entity_type)) {
    $collection
      ->add("entity.{$entity_type_id}.delete_form_for_developer", $delete_form_for_developer);
  }
  if ($analytics_for_developer = $this
    ->getAnalyticsRouteForDeveloper($entity_type)) {
    $collection
      ->add("entity.{$entity_type_id}.analytics_for_developer", $analytics_for_developer);
  }
  if ($api_keys = $this
    ->getApiKeyRouteDeveloperApp($entity_type)) {
    $collection
      ->add("entity.{$entity_type_id}.api_keys", $api_keys);
  }
  if ($add_api_key_form = $this
    ->getAddApiKeyRoute($entity_type)) {
    $collection
      ->add("entity.{$entity_type_id}.add_api_key_form", $add_api_key_form);
  }
  if ($delete_api_key_form = $this
    ->getDeleteApiKeyRoute($entity_type)) {
    $collection
      ->add("entity.{$entity_type_id}.delete_api_key_form", $delete_api_key_form);
  }
  if ($revoke_api_key_form = $this
    ->getRevokeApiKeyRoute($entity_type)) {
    $collection
      ->add("entity.{$entity_type_id}.revoke_api_key_form", $revoke_api_key_form);
  }
  return $collection;
}