function EntityRouteEnhancer::applies

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Enhancer/EntityRouteEnhancer.php \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer::applies()
  2. 8.9.x core/lib/Drupal/Core/Entity/Enhancer/EntityRouteEnhancer.php \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer::applies()
  3. 10 core/lib/Drupal/Core/Entity/Enhancer/EntityRouteEnhancer.php \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer::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 EntityRouteEnhancer::applies()
EntityRouteEnhancer::enhance in core/lib/Drupal/Core/Entity/Enhancer/EntityRouteEnhancer.php
Updates the defaults for a route definition based on the request.

File

core/lib/Drupal/Core/Entity/Enhancer/EntityRouteEnhancer.php, line 46

Class

EntityRouteEnhancer
Enhances an entity form route with the appropriate controller.

Namespace

Drupal\Core\Entity\Enhancer

Code

protected function applies(Route $route) {
    return !$route->hasDefault('_controller') && ($route->hasDefault('_entity_form') || $route->hasDefault('_entity_list') || $route->hasDefault('_entity_view'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.