You are here

class HeartbeatRouteSubscriber in Heartbeat 8

Hierarchy

Expanded class hierarchy of HeartbeatRouteSubscriber

1 string reference to 'HeartbeatRouteSubscriber'
heartbeat.services.yml in ./heartbeat.services.yml
heartbeat.services.yml
1 service uses HeartbeatRouteSubscriber
heartbeat.route_subscriber in ./heartbeat.services.yml
Drupal\heartbeat\Routing\HeartbeatRouteSubscriber

File

src/Routing/HeartbeatRouteSubscriber.php, line 15

Namespace

Drupal\heartbeat\Routing
View 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

Namesort descending Modifiers Type Description Overrides
HeartbeatRouteSubscriber::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