protected function RouteSubscriber::getEntityTypeDefinitionRoute in Devel 4.x
Same name and namespace in other branches
- 8.3 src/Routing/RouteSubscriber.php \Drupal\devel\Routing\RouteSubscriber::getEntityTypeDefinitionRoute()
- 8 src/Routing/RouteSubscriber.php \Drupal\devel\Routing\RouteSubscriber::getEntityTypeDefinitionRoute()
- 8.2 src/Routing/RouteSubscriber.php \Drupal\devel\Routing\RouteSubscriber::getEntityTypeDefinitionRoute()
Gets the entity type definition route.
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 RouteSubscriber::getEntityTypeDefinitionRoute()
- RouteSubscriber::alterRoutes in src/
Routing/ RouteSubscriber.php - Alters existing routes for a specific collection.
File
- src/
Routing/ RouteSubscriber.php, line 125
Class
- RouteSubscriber
- Subscriber for Devel routes.
Namespace
Drupal\devel\RoutingCode
protected function getEntityTypeDefinitionRoute(EntityTypeInterface $entity_type) {
if ($devel_definition = $entity_type
->getLinkTemplate('devel-definition')) {
$entity_type_id = $entity_type
->id();
$route = new Route($devel_definition);
$route
->addDefaults([
'_controller' => '\\Drupal\\devel\\Controller\\EntityDebugController::entityTypeDefinition',
'_title' => 'Entity type definition',
])
->addRequirements([
'_permission' => 'access devel information',
])
->setOption('_admin_route', TRUE)
->setOption('_devel_entity_type_id', $entity_type_id)
->setOption('parameters', [
$entity_type_id => [
'type' => 'entity:' . $entity_type_id,
],
]);
return $route;
}
}