function DrupalKernel::getServicesToPersist
Same name in other branches
- 9 core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::getServicesToPersist()
- 8.9.x core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::getServicesToPersist()
- 10 core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::getServicesToPersist()
Returns service instances to persist from an old container to a new one.
2 calls to DrupalKernel::getServicesToPersist()
- DrupalKernel::attachSynthetic in core/
lib/ Drupal/ Core/ DrupalKernel.php - Attach synthetic values on to kernel.
- DrupalKernel::resetContainer in core/
lib/ Drupal/ Core/ DrupalKernel.php - Force a container reset.
File
-
core/
lib/ Drupal/ Core/ DrupalKernel.php, line 1113
Class
- DrupalKernel
- The DrupalKernel class is the core of Drupal itself.
Namespace
Drupal\CoreCode
protected function getServicesToPersist(ContainerInterface $container) {
$persist = [];
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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.