You are here

public function TeamInvitationRouteProvider::getRoutes in Apigee Edge 8

Provides routes for entities.

Parameters

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

Return value

\Symfony\Component\Routing\RouteCollection|\Symfony\Component\Routing\Route[] Returns a route collection or an array of routes keyed by name, like route_callbacks inside 'routing.yml' files.

Overrides DefaultHtmlRouteProvider::getRoutes

File

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

Class

TeamInvitationRouteProvider
Provides entity routes for team_invitation.

Namespace

Drupal\apigee_edge_teams\Entity

Code

public function getRoutes(EntityTypeInterface $entity_type) {
  $collection = parent::getRoutes($entity_type);
  $entity_type_id = $entity_type
    ->id();
  if ($delete_form = $this
    ->getDeleteFormRoute($entity_type)) {
    $collection
      ->add("entity.{$entity_type_id}.delete_form", $delete_form);
  }
  if ($accept_form = $this
    ->getAcceptFormRoute($entity_type)) {
    $collection
      ->add("entity.{$entity_type_id}.accept_form", $accept_form);
  }
  if ($decline_form = $this
    ->getDeclineFormRoute($entity_type)) {
    $collection
      ->add("entity.{$entity_type_id}.decline_form", $decline_form);
  }
  if ($resend_form = $this
    ->getResentFormRoute($entity_type)) {
    $collection
      ->add("entity.{$entity_type_id}.resend_form", $resend_form);
  }
  return $collection;
}