function EntityRevisionRouteEnhancer::applies
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Routing/Enhancer/EntityRevisionRouteEnhancer.php \Drupal\Core\Routing\Enhancer\EntityRevisionRouteEnhancer::applies()
- 10 core/lib/Drupal/Core/Routing/Enhancer/EntityRevisionRouteEnhancer.php \Drupal\Core\Routing\Enhancer\EntityRevisionRouteEnhancer::applies()
- 11.x core/lib/Drupal/Core/Routing/Enhancer/EntityRevisionRouteEnhancer.php \Drupal\Core\Routing\Enhancer\EntityRevisionRouteEnhancer::applies()
Returns whether the enhancer runs on the current route.
Parameters
\Symfony\Component\Routing\Route $route: The current route.
Return value
bool
1 call to EntityRevisionRouteEnhancer::applies()
- EntityRevisionRouteEnhancer::enhance in core/
lib/ Drupal/ Core/ Routing/ Enhancer/ EntityRevisionRouteEnhancer.php - Updates the defaults for a route definition based on the request.
File
-
core/
lib/ Drupal/ Core/ Routing/ Enhancer/ EntityRevisionRouteEnhancer.php, line 23
Class
- EntityRevisionRouteEnhancer
- Adds _entity_revision to the request attributes, if possible.
Namespace
Drupal\Core\Routing\EnhancerCode
protected function applies(Route $route) {
// Check whether there is any entity revision parameter.
$parameters = $route->getOption('parameters') ?: [];
foreach ($parameters as $info) {
if (isset($info['type']) && strpos($info['type'], 'entity_revision:') === 0) {
return TRUE;
}
}
return FALSE;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.