You are here

protected function DrupalKernel::getServicesToPersist in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::getServicesToPersist()

Returns service instances to persist from an old container to a new one.

1 call to DrupalKernel::getServicesToPersist()
DrupalKernel::attachSynthetic in core/lib/Drupal/Core/DrupalKernel.php
Attach synthetic values on to kernel.

File

core/lib/Drupal/Core/DrupalKernel.php, line 1027
Contains \Drupal\Core\DrupalKernel.

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

protected function getServicesToPersist(ContainerInterface $container) {
  $persist = array();
  foreach ($container
    ->getParameter('persist_ids') as $id) {

    // It's pointless to persist services not yet initialized.
    if ($container
      ->initialized($id)) {
      $persist[$id] = $container
        ->get($id);
    }
  }
  return $persist;
}