You are here

protected function TeamAppRouteProvider::getAddFormRouteForTeam in Apigee Edge 8

Gets the add-form route for team.

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

File

modules/apigee_edge_teams/src/Entity/TeamAppRouteProvider.php, line 109

Class

TeamAppRouteProvider
Default entity routes for team apps.

Namespace

Drupal\apigee_edge_teams\Entity

Code

protected function getAddFormRouteForTeam(EntityTypeInterface $entity_type) {
  if ($entity_type
    ->hasLinkTemplate('add-form-for-team')) {
    $route = new Route($entity_type
      ->getLinkTemplate('add-form-for-team'));
    $route
      ->setDefault('_entity_form', 'team_app.add_for_team');
    $route
      ->setDefault('_title_callback', AppTitleProvider::class . '::addTitle');
    $route
      ->setDefault('entity_type_id', $entity_type
      ->id());
    $this
      ->ensureTeamParameter($route);
    $route
      ->setRequirement('_entity_create_access', $entity_type
      ->id());
    return $route;
  }
}