You are here

protected function GroupRouteProvider::getCollectionRoute in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/Routing/GroupRouteProvider.php \Drupal\group\Entity\Routing\GroupRouteProvider::getCollectionRoute()

Gets the collection route.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.

Return value

\Symfony\Component\Routing\Route|null The generated route, if available.

Overrides DefaultHtmlRouteProvider::getCollectionRoute

File

src/Entity/Routing/GroupRouteProvider.php, line 58

Class

GroupRouteProvider
Provides routes for groups.

Namespace

Drupal\group\Entity\Routing

Code

protected function getCollectionRoute(EntityTypeInterface $entity_type) {

  // @todo Remove this method when https://www.drupal.org/node/2767025 lands.
  if ($route = parent::getCollectionRoute($entity_type)) {
    $route
      ->setDefault('_title', 'Groups');
    $route
      ->setDefault('_title_arguments', []);
    $route
      ->setRequirement('_permission', 'access group overview');
    return $route;
  }
}