protected function DrupalKernel::getServicesToPersist

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

1 call to DrupalKernel::getServicesToPersist()
DrupalKernel::initializeContainer in drupal/core/lib/Drupal/Core/DrupalKernel.php
Initializes the service container.

File

drupal/core/lib/Drupal/Core/DrupalKernel.php, line 387
Definition of Drupal\Core\DrupalKernel.

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

protected function getServicesToPersist() {
  $persist = array();
  if (isset($this->container)) {
    foreach ($this->container
      ->getParameter('persistIds') as $id) {

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