You are here

protected function DevelRouteSubscriber::alterRoutes in Search API Solr 8.3

Same name and namespace in other branches
  1. 8.2 search_api_solr_devel/src/Routing/DevelRouteSubscriber.php \Drupal\search_api_solr_devel\Routing\DevelRouteSubscriber::alterRoutes()
  2. 4.x modules/search_api_solr_devel/src/Routing/DevelRouteSubscriber.php \Drupal\search_api_solr_devel\Routing\DevelRouteSubscriber::alterRoutes()

Alters existing routes for a specific collection.

Parameters

\Symfony\Component\Routing\RouteCollection $collection: The route collection for adding routes.

Overrides RouteSubscriberBase::alterRoutes

File

modules/search_api_solr_devel/src/Routing/DevelRouteSubscriber.php, line 37

Class

DevelRouteSubscriber
Subscriber for Search Api Solr routes.

Namespace

Drupal\search_api_solr_devel\Routing

Code

protected function alterRoutes(RouteCollection $collection) {
  foreach ($this->entityTypeManager
    ->getDefinitions() as $entity_type_id => $entity_type) {
    if ($route = $this
      ->getDevelSolrRoute($entity_type)) {
      $collection
        ->add("entity.{$entity_type_id}.devel_solr", $route);
    }
  }
}