SerializationBundle.php

Contains \Drupal\serialization\SerializationBundle.

Namespace

Drupal\serialization

File

drupal/core/modules/serialization/lib/Drupal/serialization/SerializationBundle.php
View source
<?php

/**
 * @file
 * Contains \Drupal\serialization\SerializationBundle.
 */
namespace Drupal\serialization;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
 * Serialization dependency injection container.
 */
class SerializationBundle extends Bundle {

  /**
   * Overrides \Symfony\Component\HttpKernel\Bundle\Bundle::build().
   */
  public function build(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

Namesort descending Description
SerializationBundle Serialization dependency injection container.