final class TeamAppDevelRouteFixerSubscriber in Apigee Edge 8
Fixes the entity routes generated by the Devel module.
TeamAppByNameRouteAlterSubscriber adds another changes if needed.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\apigee_edge_teams\Routing\TeamAppDevelRouteFixerSubscriber
Expanded class hierarchy of TeamAppDevelRouteFixerSubscriber
See also
apigee_edge_teams_entity_type_alter()
\Drupal\apigee_edge_teams\Routing\TeamAppByNameRouteAlterSubscriber
1 string reference to 'TeamAppDevelRouteFixerSubscriber'
- apigee_edge_teams.services.yml in modules/
apigee_edge_teams/ apigee_edge_teams.services.yml - modules/apigee_edge_teams/apigee_edge_teams.services.yml
1 service uses TeamAppDevelRouteFixerSubscriber
File
- modules/
apigee_edge_teams/ src/ Routing/ TeamAppDevelRouteFixerSubscriber.php, line 35
Namespace
Drupal\apigee_edge_teams\RoutingView source
final class TeamAppDevelRouteFixerSubscriber extends RouteSubscriberBase {
/**
* The module handler service.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
private $moduleHandler;
/**
* TeamAppDevelRouteFixerSubscriber constructor.
*
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler service.
*/
public function __construct(ModuleHandlerInterface $module_handler) {
$this->moduleHandler = $module_handler;
}
/**
* {@inheritdoc}
*/
protected function alterRoutes(RouteCollection $collection) {
if ($this->moduleHandler
->moduleExists('devel')) {
foreach ($collection as $id => $route) {
if (strpos($id, 'entity.team_app.devel') === 0) {
$route
->setOption('_devel_entity_type_id', 'app');
}
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
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 |
TeamAppDevelRouteFixerSubscriber:: |
private | property | The module handler service. | |
TeamAppDevelRouteFixerSubscriber:: |
protected | function |
Alters existing routes for a specific collection. Overrides RouteSubscriberBase:: |
|
TeamAppDevelRouteFixerSubscriber:: |
public | function | TeamAppDevelRouteFixerSubscriber constructor. |