class HeartbeatRouteSubscriber in Heartbeat 8
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\heartbeat\Routing\HeartbeatRouteSubscriber
Expanded class hierarchy of HeartbeatRouteSubscriber
1 string reference to 'HeartbeatRouteSubscriber'
1 service uses HeartbeatRouteSubscriber
File
- src/
Routing/ HeartbeatRouteSubscriber.php, line 15
Namespace
Drupal\heartbeat\RoutingView source
class HeartbeatRouteSubscriber extends RouteSubscriberBase {
/**
* Alters existing routes for a specific collection.
*
* @param \Symfony\Component\Routing\RouteCollection $collection
* The route collection for adding routes.
*/
protected function alterRoutes(RouteCollection $collection) {
if ($collection) {
if ($thisroute = $collection
->get('heartbeat.update_feed')) {
$path = $thisroute
->getPath();
}
}
if ($route = $collection
->get('heartbeat.user_edit')) {
if ($route !== null) {
$route
->setPath('/user/' . \Drupal::currentUser()
->id() . '/edit');
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HeartbeatRouteSubscriber:: |
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 |