You are here

private function TeamRoutingHelperTrait::ensureTeamParameter in Apigee Edge 8

If route contains the {team} parameter add required changes to the route.

Parameters

\Symfony\Component\Routing\Route $route: The route to be checked and altered if needed.

12 calls to TeamRoutingHelperTrait::ensureTeamParameter()
TeamAppRouteProvider::getAddApiKeyRoute in modules/apigee_edge_teams/src/Entity/TeamAppRouteProvider.php
Gets the add-api-key-form route for a team app.
TeamAppRouteProvider::getAddFormRouteForTeam in modules/apigee_edge_teams/src/Entity/TeamAppRouteProvider.php
Gets the add-form route for team.
TeamAppRouteProvider::getCollectionRouteByTeam in modules/apigee_edge_teams/src/Entity/TeamAppRouteProvider.php
Gets the collection route for a team.
TeamAppRouteProvider::getDeleteApiKeyRoute in modules/apigee_edge_teams/src/Entity/TeamAppRouteProvider.php
Gets the delete-api-key-form route for a team app.
TeamAppRouteProvider::getRevokeApiKeyRoute in modules/apigee_edge_teams/src/Entity/TeamAppRouteProvider.php
Gets the revoke-api-key-form route for a team app.

... See full list

File

modules/apigee_edge_teams/src/Entity/TeamRoutingHelperTrait.php, line 36

Class

TeamRoutingHelperTrait
Contains utility methods for team and team app routes.

Namespace

Drupal\apigee_edge_teams\Entity

Code

private function ensureTeamParameter(Route $route) {
  if (strpos($route
    ->getPath(), '{team}') !== FALSE) {

    // Make sure the parameter 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',
      ],
    ]);
  }
}