SerializationServiceProvider.php 776 Bytes
Newer Older
1 2 3 4
<?php

/**
 * @file
5
 * Contains \Drupal\serialization\SerializationServiceProvider.
6 7 8 9
 */

namespace Drupal\serialization;

10 11
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderInterface;
12 13 14 15

/**
 * Serialization dependency injection container.
 */
16
class SerializationServiceProvider implements ServiceProviderInterface {
17 18

  /**
19
   * {@inheritdoc}
20
   */
21
  public function register(ContainerBuilder $container) {
22 23
    // Add a compiler pass for adding Normalizers and Encoders to Serializer.
    $container->addCompilerPass(new RegisterSerializationClassesCompilerPass());
24 25
    // Add a compiler pass for adding concrete Resolvers to chain Resolver.
    $container->addCompilerPass(new RegisterEntityResolversCompilerPass());
26 27
  }
}