DrupalKernel::persistServices

protected DrupalKernel::persistServices(ContainerInterface $container, array $persist)

Moves persistent service instances into a new container.

File

core/lib/Drupal/Core/DrupalKernel.php, line 1096

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

protected function persistServices(ContainerInterface $container, array $persist) {
  foreach ($persist as $id => $object) {
    // Do not override services already set() on the new container, for
    // example 'service_container'.
    if (!$container->initialized($id)) {
      $container->set($id, $object);
    }
  }
}
doc_Drupal
2016-10-29 09:03:03
Comments
Leave a Comment

Please login to continue.