function KernelDestructionSubscriber::registerService

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php \Drupal\Core\EventSubscriber\KernelDestructionSubscriber::registerService()
  2. 8.9.x core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php \Drupal\Core\EventSubscriber\KernelDestructionSubscriber::registerService()
  3. 10 core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php \Drupal\Core\EventSubscriber\KernelDestructionSubscriber::registerService()

Registers a service for destruction.

Calls to this method are set up in RegisterServicesForDestructionPass::process().

Parameters

string $id: Name of the service.

File

core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php, line 38

Class

KernelDestructionSubscriber
Destructs services that are initiated and tagged with "needs_destruction".

Namespace

Drupal\Core\EventSubscriber

Code

public function registerService($id) {
    $this->services[] = $id;
}

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