SerializationServiceProvider::register

public SerializationServiceProvider::register(ContainerBuilder $container)

Registers services to the container.

Parameters

ContainerBuilder $container: The ContainerBuilder to register services to.

Overrides ServiceProviderInterface::register

File

core/modules/serialization/src/SerializationServiceProvider.php, line 16

Class

SerializationServiceProvider
Serialization dependency injection container.

Namespace

Drupal\serialization

Code

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());
}
doc_Drupal
2016-10-29 09:41:54
Comments
Leave a Comment

Please login to continue.