function EntityPermissionsRouteProvider::getRoutes

Same name in other branches
  1. 9 core/modules/user/src/Entity/EntityPermissionsRouteProvider.php \Drupal\user\Entity\EntityPermissionsRouteProvider::getRoutes()
  2. 11.x core/modules/user/src/Entity/EntityPermissionsRouteProvider.php \Drupal\user\Entity\EntityPermissionsRouteProvider::getRoutes()

Overrides EntityRouteProviderInterface::getRoutes

File

core/modules/user/src/Entity/EntityPermissionsRouteProvider.php, line 55

Class

EntityPermissionsRouteProvider
Provides routes for the entity permissions form.

Namespace

Drupal\user\Entity

Code

public function getRoutes(EntityTypeInterface $entity_type) {
    $collection = new RouteCollection();
    $entity_type_id = $entity_type->id();
    if ($entity_permissions_route = $this->getEntityPermissionsRoute($entity_type)) {
        $collection->add("entity.{$entity_type_id}.entity_permissions_form", $entity_permissions_route);
    }
    return $collection;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.