You are here

protected function ContentModerationRouteSubscriber::alterRoutes in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/content_moderation/src/Routing/ContentModerationRouteSubscriber.php \Drupal\content_moderation\Routing\ContentModerationRouteSubscriber::alterRoutes()
  2. 10 core/modules/content_moderation/src/Routing/ContentModerationRouteSubscriber.php \Drupal\content_moderation\Routing\ContentModerationRouteSubscriber::alterRoutes()

Alters existing routes for a specific collection.

Parameters

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

Overrides RouteSubscriberBase::alterRoutes

File

core/modules/content_moderation/src/Routing/ContentModerationRouteSubscriber.php, line 51

Class

ContentModerationRouteSubscriber
Subscriber for moderated revisionable entity forms.

Namespace

Drupal\content_moderation\Routing

Code

protected function alterRoutes(RouteCollection $collection) {
  foreach ($collection as $route) {
    $this
      ->setLatestRevisionFlag($route);
  }
}