You are here

public function EdgeEntityFieldConfigListRouteSubscriber::alterRoutes in Apigee Edge 8

Alters Apigee Edge entity related field config listing UI routes.

Parameters

\Drupal\Core\Routing\RouteBuildEvent $event: The route build event.

File

src/Routing/EdgeEntityFieldConfigListRouteSubscriber.php, line 67

Class

EdgeEntityFieldConfigListRouteSubscriber
Replaces the controller on Apigee Edge entities' field config listing UI.

Namespace

Drupal\apigee_edge\Routing

Code

public function alterRoutes(RouteBuildEvent $event) {
  foreach ($this->entityTypeManager
    ->getDefinitions() as $entity_type) {
    if (in_array(EdgeEntityInterface::class, class_implements($entity_type
      ->getOriginalClass())) && ($route = $event
      ->getRouteCollection()
      ->get("entity.{$entity_type->id()}.field_ui_fields"))) {
      $route
        ->setDefault('_controller', EdgeEntityFieldConfigListController::class . '::listing');
    }
  }
}