final class DeveloperAppByNameRouteAlterSubscriber in Apigee Edge 8
Registers the 'type' of the 'app' route parameter if 'user' is available.
The {developer_app} parameter can be automatically resolved by EntityResolverManager, but in that case the value of in the path is the app id (UUID) and not the name of an app.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\apigee_edge\Routing\DeveloperAppByNameRouteAlterSubscriber
Expanded class hierarchy of DeveloperAppByNameRouteAlterSubscriber
See also
\Drupal\apigee_edge\Entity\DeveloperApp::urlRouteParameters()
\Drupal\apigee_edge\ParamConverter\DeveloperAppNameConverter
1 string reference to 'DeveloperAppByNameRouteAlterSubscriber'
1 service uses DeveloperAppByNameRouteAlterSubscriber
File
- src/
Routing/ DeveloperAppByNameRouteAlterSubscriber.php, line 36
Namespace
Drupal\apigee_edge\RoutingView source
final class DeveloperAppByNameRouteAlterSubscriber extends RouteSubscriberBase {
/**
* {@inheritdoc}
*/
protected function alterRoutes(RouteCollection $collection) {
foreach ($collection as $id => $route) {
if (strpos($id, 'entity.developer_app') !== FALSE && in_array('user', $route
->compile()
->getPathVariables()) && in_array('app', $route
->compile()
->getPathVariables())) {
$params = $route
->getOption('parameters') ?? [];
NestedArray::setValue($params, [
'app',
'type',
], 'developer_app_by_name');
$route
->setOption('parameters', $params);
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeveloperAppByNameRouteAlterSubscriber:: |
protected | function |
Alters existing routes for a specific collection. Overrides RouteSubscriberBase:: |
|
RouteSubscriberBase:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | 5 |
RouteSubscriberBase:: |
public | function | Delegates the route altering to self::alterRoutes(). | 1 |