protected function CheckProvider::applies in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Access/CheckProvider.php \Drupal\Core\Access\CheckProvider::applies()
Determine which registered access checks apply to a route.
Parameters
\Symfony\Component\Routing\Route $route: The route to get list of access checks for.
Return value
array An array of service ids for the access checks that apply to passed route.
1 call to CheckProvider::applies()
- CheckProvider::setChecks in core/
lib/ Drupal/ Core/ Access/ CheckProvider.php - For each route, saves a list of applicable access checks to the route.
File
- core/
lib/ Drupal/ Core/ Access/ CheckProvider.php, line 126 - Contains \Drupal\Core\Access\CheckProvider.
Class
- CheckProvider
- Loads access checkers from the container.
Namespace
Drupal\Core\AccessCode
protected function applies(Route $route) {
$checks = array();
// Iterate through map requirements from appliesTo() on access checkers.
// Only iterate through all checkIds if this is not used.
foreach ($route
->getRequirements() as $key => $value) {
if (isset($this->staticRequirementMap[$key])) {
foreach ($this->staticRequirementMap[$key] as $service_id) {
$checks[] = $service_id;
}
}
}
// Finally, see if any dynamic access checkers apply.
foreach ($this->dynamicRequirementMap as $service_id) {
if ($this->checks[$service_id]
->applies($route)) {
$checks[] = $service_id;
}
}
return $checks;
}