class GroupLatestRevisionRouteSubscriber in Group 8
Same name and namespace in other branches
- 2.0.x src/Entity/Routing/GroupLatestRevisionRouteSubscriber.php \Drupal\group\Entity\Routing\GroupLatestRevisionRouteSubscriber
Swaps out the latest revision page access callback.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\group\Entity\Routing\GroupLatestRevisionRouteSubscriber
Expanded class hierarchy of GroupLatestRevisionRouteSubscriber
1 string reference to 'GroupLatestRevisionRouteSubscriber'
1 service uses GroupLatestRevisionRouteSubscriber
File
- src/
Entity/ Routing/ GroupLatestRevisionRouteSubscriber.php, line 11
Namespace
Drupal\group\Entity\RoutingView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GroupLatestRevisionRouteSubscriber:: |
protected | function |
Alters existing routes for a specific collection. Overrides RouteSubscriberBase:: |
|
RouteSubscriberBase:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | 5 |
RouteSubscriberBase:: |
public | function | Delegates the route altering to self::alterRoutes(). | 1 |