You are here

protected function WebformSubmissionLogRouteSubscriber::alterRoutes in Webform 8.5

Same name and namespace in other branches
  1. 6.x modules/webform_submission_log/src/Routing/WebformSubmissionLogRouteSubscriber.php \Drupal\webform_submission_log\Routing\WebformSubmissionLogRouteSubscriber::alterRoutes()

Alters existing routes for a specific collection.

Parameters

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

Overrides RouteSubscriberBase::alterRoutes

File

modules/webform_submission_log/src/Routing/WebformSubmissionLogRouteSubscriber.php, line 34

Class

WebformSubmissionLogRouteSubscriber
Remove webform node log routes.

Namespace

Drupal\webform_submission_log\Routing

Code

protected function alterRoutes(RouteCollection $collection) {
  if (!$this->moduleHandler
    ->moduleExists('webform_node')) {
    $collection
      ->remove('entity.node.webform.results_log');
    $collection
      ->remove('entity.node.webform_submission.log');
  }
}