Same name in other branches
  1. 8.x-1.x src/Routing/RouteSubscriber.php \Drupal\entity_clone\Routing\RouteSubscriber::alterRoutes()

File

src/Routing/RouteSubscriber.php, line 37

Class

RouteSubscriber
Subscriber for Entity Clone routes.

Namespace

Drupal\entity_clone\Routing

Code

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