function CheckProvider::setChecks

Same name in other branches
  1. 9 core/lib/Drupal/Core/Access/CheckProvider.php \Drupal\Core\Access\CheckProvider::setChecks()
  2. 10 core/lib/Drupal/Core/Access/CheckProvider.php \Drupal\Core\Access\CheckProvider::setChecks()
  3. 11.x core/lib/Drupal/Core/Access/CheckProvider.php \Drupal\Core\Access\CheckProvider::setChecks()

Overrides CheckProviderInterface::setChecks

File

core/lib/Drupal/Core/Access/CheckProvider.php, line 82

Class

CheckProvider
Loads access checkers from the container.

Namespace

Drupal\Core\Access

Code

public function setChecks(RouteCollection $routes) {
    $this->loadDynamicRequirementMap();
    foreach ($routes as $route) {
        if ($checks = $this->applies($route)) {
            $route->setOption('_access_checks', $checks);
        }
    }
}

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