You are here

protected function TeamRouteProvider::getRemoveTeamMemberRoute in Apigee Edge 8

Gets the remove team member route.

Parameters

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

Return value

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

1 call to TeamRouteProvider::getRemoveTeamMemberRoute()
TeamRouteProvider::getRoutes in modules/apigee_edge_teams/src/Entity/TeamRouteProvider.php
Provides routes for entities.

File

modules/apigee_edge_teams/src/Entity/TeamRouteProvider.php, line 185

Class

TeamRouteProvider
Team specific dynamic entity route provider.

Namespace

Drupal\apigee_edge_teams\Entity

Code

protected function getRemoveTeamMemberRoute(EntityTypeInterface $entity_type) {

  // Because this path depends on the {developer} route parameter that
  // can not be resolved in Team::urlRouteParameters() therefore this path
  // can not be defined in the link templates defined on the Team entity.
  $route = new Route('/teams/{team}/members/{developer}/remove');
  $route
    ->setDefault('_form', RemoveTeamMemberForm::class);
  $route
    ->setDefault('_title', 'Remove member');
  $route
    ->setDefault('entity_type_id', $entity_type
    ->id());
  $route
    ->setRequirement('_apigee_edge_teams_manage_team_access', 'TRUE');

  // Make sure parameters gets up-casted.
  // (This also ensures that we get an "Page not found" page if user with
  // uid does not exist.)
  $route
    ->setOption('parameters', [
    'team' => [
      'type' => 'entity:team',
      'converter' => 'paramconverter.entity',
    ],
    'developer' => [
      'converter' => 'paramconverter.developer_with_user',
    ],
  ]);
  return $route;
}