class DependencySerializationTraitPass in Service Container 7
Same name and namespace in other branches
- 7.2 lib/Drupal/Core/DependencyInjection/Compiler/DependencySerializationTraitPass.php \Drupal\Core\DependencyInjection\Compiler\DependencySerializationTraitPass
Sets the _serviceId property on all services.
Hierarchy
- class \Drupal\Core\DependencyInjection\Compiler\DependencySerializationTraitPass implements CompilerPassInterface
Expanded class hierarchy of DependencySerializationTraitPass
See also
\Drupal\Core\DependencyInjection\DependencySerializationTrait
File
- lib/
Drupal/ Core/ DependencyInjection/ Compiler/ DependencySerializationTraitPass.php, line 18 - Contains \Drupal\Core\DependencyInjection\Compiler\DependencySerializationTraitPass.
Namespace
Drupal\Core\DependencyInjection\CompilerView source
class DependencySerializationTraitPass implements CompilerPassInterface {
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container) {
foreach ($container
->getDefinitions() as $service_id => $definition) {
// Only add the property to services that are public (as private services
// can not be reloaded through Container::get()) and are objects.
if (!$definition
->hasTag('parameter_service') && $definition
->isPublic()) {
$definition
->setProperty('_serviceId', $service_id);
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTraitPass:: |
public | function |
You can modify the container here before it is dumped to PHP code. Overrides CompilerPassInterface:: |