function SerializationServiceProvider::register
Same name in other branches
- 9 core/modules/serialization/src/SerializationServiceProvider.php \Drupal\serialization\SerializationServiceProvider::register()
- 8.9.x core/modules/serialization/src/SerializationServiceProvider.php \Drupal\serialization\SerializationServiceProvider::register()
- 10 core/modules/serialization/src/SerializationServiceProvider.php \Drupal\serialization\SerializationServiceProvider::register()
Overrides ServiceProviderInterface::register
File
-
core/
modules/ serialization/ src/ SerializationServiceProvider.php, line 16
Class
- SerializationServiceProvider
- Serialization dependency injection container.
Namespace
Drupal\serializationCode
public function register(ContainerBuilder $container) {
// Add a compiler pass for adding Normalizers and Encoders to Serializer.
$container->addCompilerPass(new RegisterSerializationClassesCompilerPass());
// Add a compiler pass for adding concrete Resolvers to chain Resolver.
$container->addCompilerPass(new RegisterEntityResolversCompilerPass());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.