trait TeamRoutingHelperTrait in Apigee Edge 8
Contains utility methods for team and team app routes.
Hierarchy
- trait \Drupal\apigee_edge_teams\Entity\TeamRoutingHelperTrait
File
- modules/
apigee_edge_teams/ src/ Entity/ TeamRoutingHelperTrait.php, line 28
Namespace
Drupal\apigee_edge_teams\EntityView source
trait TeamRoutingHelperTrait {
/**
* If route contains the {team} parameter add required changes to the route.
*
* @param \Symfony\Component\Routing\Route $route
* The route to be checked and altered if needed.
*/
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',
],
]);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TeamRoutingHelperTrait:: |
private | function | If route contains the {team} parameter add required changes to the route. |