You are here

protected function TeamInvitationRouteProvider::getAcceptFormRoute in Apigee Edge 8

Gets the accept-form route for team_invitation.

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 TeamInvitationRouteProvider::getAcceptFormRoute()
TeamInvitationRouteProvider::getRoutes in modules/apigee_edge_teams/src/Entity/TeamInvitationRouteProvider.php
Provides routes for entities.

File

modules/apigee_edge_teams/src/Entity/TeamInvitationRouteProvider.php, line 113

Class

TeamInvitationRouteProvider
Provides entity routes for team_invitation.

Namespace

Drupal\apigee_edge_teams\Entity

Code

protected function getAcceptFormRoute(EntityTypeInterface $entity_type) {
  if ($entity_type
    ->hasLinkTemplate('accept-form')) {
    $entity_type_id = $entity_type
      ->id();
    $route = new Route($entity_type
      ->getLinkTemplate('accept-form'));
    $route
      ->setDefault('_entity_form', "{$entity_type_id}.accept");
    $route
      ->setDefault('_title_callback', TeamInvitationTitleProvider::class . '::acceptTitle');
    $route
      ->setDefault('entity_type_id', $entity_type_id);
    $this
      ->ensureTeamParameter($route);
    $route
      ->setRequirement('_entity_access', "{$entity_type_id}.accept");
    return $route;
  }
}