function CheckProvider::addCheckService

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

Overrides CheckProviderInterface::addCheckService

File

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

Class

CheckProvider
Loads access checkers from the container.

Namespace

Drupal\Core\Access

Code

public function addCheckService($service_id, $service_method, array $applies_checks = [], $needs_incoming_request = FALSE) {
    $this->checkIds[] = $service_id;
    $this->checkMethods[$service_id] = $service_method;
    if ($needs_incoming_request) {
        $this->checksNeedsRequest[$service_id] = $service_id;
    }
    foreach ($applies_checks as $applies_check) {
        $this->staticRequirementMap[$applies_check][] = $service_id;
    }
}

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