You are here

TypedDataNormalizer.php in Zircon Profile 8

Same filename and directory in other branches
  1. 8.0 core/modules/serialization/src/Normalizer/TypedDataNormalizer.php

File

core/modules/serialization/src/Normalizer/TypedDataNormalizer.php
View source
<?php

/**
 * @file
 * Contains \Drupal\serialization\Normalizer\TypedDataNormalizer.
 */
namespace Drupal\serialization\Normalizer;


/**
 * Converts typed data objects to arrays.
 */
class TypedDataNormalizer extends NormalizerBase {

  /**
   * The interface or class that this Normalizer supports.
   *
   * @var string
   */
  protected $supportedInterfaceOrClass = 'Drupal\\Core\\TypedData\\TypedDataInterface';

  /**
   * {@inheritdoc}
   */
  public function normalize($object, $format = NULL, array $context = array()) {
    return $object
      ->getValue();
  }

}

Classes

Namesort descending Description
TypedDataNormalizer Converts typed data objects to arrays.