You are here

class GroupLatestRevisionRouteSubscriber in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/Routing/GroupLatestRevisionRouteSubscriber.php \Drupal\group\Entity\Routing\GroupLatestRevisionRouteSubscriber

Swaps out the latest revision page access callback.

Hierarchy

Expanded class hierarchy of GroupLatestRevisionRouteSubscriber

1 string reference to 'GroupLatestRevisionRouteSubscriber'
group.services.yml in ./group.services.yml
group.services.yml
1 service uses GroupLatestRevisionRouteSubscriber
group.latest_revision.route_subscriber in ./group.services.yml
Drupal\group\Entity\Routing\GroupLatestRevisionRouteSubscriber

File

src/Entity/Routing/GroupLatestRevisionRouteSubscriber.php, line 11

Namespace

Drupal\group\Entity\Routing
View source
class GroupLatestRevisionRouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {
    if ($route = $collection
      ->get('entity.group.latest_version')) {
      $requirements = $route
        ->getRequirements();
      unset($requirements['_content_moderation_latest_version']);
      $requirements['_group_latest_revision'] = 'TRUE';
      $route
        ->setRequirements($requirements);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
GroupLatestRevisionRouteSubscriber::alterRoutes protected function Alters existing routes for a specific collection. Overrides RouteSubscriberBase::alterRoutes
RouteSubscriberBase::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. 5
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes(). 1