SerializationServiceProvider.php

Same filename in other branches
  1. 9 core/modules/serialization/src/SerializationServiceProvider.php
  2. 10 core/modules/serialization/src/SerializationServiceProvider.php
  3. 11.x core/modules/serialization/src/SerializationServiceProvider.php

Namespace

Drupal\serialization

File

core/modules/serialization/src/SerializationServiceProvider.php

View source
<?php

namespace Drupal\serialization;

use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderInterface;

/**
 * Serialization dependency injection container.
 */
class SerializationServiceProvider implements ServiceProviderInterface {
    
    /**
     * {@inheritdoc}
     */
    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());
    }

}

Classes

Title Deprecated Summary
SerializationServiceProvider Serialization dependency injection container.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.