private function ContainerBuilder::synchronize in Service Container 7
Same name in this branch
- 7 lib/Drupal/Core/DependencyInjection/ContainerBuilder.php \Drupal\Core\DependencyInjection\ContainerBuilder::synchronize()
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerBuilder.php \Symfony\Component\DependencyInjection\ContainerBuilder::synchronize()
Same name and namespace in other branches
- 7.2 lib/Drupal/Core/DependencyInjection/ContainerBuilder.php \Drupal\Core\DependencyInjection\ContainerBuilder::synchronize()
Synchronizes a service change.
This method is a copy of the ContainerBuilder of symfony.
This method updates all services that depend on the given service by calling all methods referencing it.
Parameters
string $id A service id:
Overrides ContainerBuilder::synchronize
File
- lib/
Drupal/ Core/ DependencyInjection/ ContainerBuilder.php, line 85 - Contains \Drupal\Core\DependencyInjection\ContainerBuilder.
Class
- ContainerBuilder
- Drupal's dependency injection container builder.
Namespace
Drupal\Core\DependencyInjectionCode
private function synchronize($id) {
foreach ($this
->getDefinitions() as $definitionId => $definition) {
// only check initialized services
if (!$this
->initialized($definitionId)) {
continue;
}
foreach ($definition
->getMethodCalls() as $call) {
foreach ($call[1] as $argument) {
if ($argument instanceof Reference && $id == (string) $argument) {
$this
->callMethod($this
->get($definitionId), $call);
}
}
}
}
}