You are here

class TypedDataNormalizer in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/serialization/src/Normalizer/TypedDataNormalizer.php \Drupal\serialization\Normalizer\TypedDataNormalizer

Converts typed data objects to arrays.

Hierarchy

Expanded class hierarchy of TypedDataNormalizer

1 file declares its use of TypedDataNormalizer
TypedDataNormalizerTest.php in core/modules/serialization/tests/src/Unit/Normalizer/TypedDataNormalizerTest.php
Contains \Drupal\Tests\serialization\Unit\Normalizer\TypedDataNormalizerTest.
1 string reference to 'TypedDataNormalizer'
serialization.services.yml in core/modules/serialization/serialization.services.yml
core/modules/serialization/serialization.services.yml
1 service uses TypedDataNormalizer
serializer.normalizer.typed_data in core/modules/serialization/serialization.services.yml
Drupal\serialization\Normalizer\TypedDataNormalizer

File

core/modules/serialization/src/Normalizer/TypedDataNormalizer.php, line 13
Contains \Drupal\serialization\Normalizer\TypedDataNormalizer.

Namespace

Drupal\serialization\Normalizer
View source
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();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NormalizerBase::checkFormat protected function Checks if the provided format is supported by this normalizer.
NormalizerBase::supportsDenormalization public function Implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface::supportsDenormalization() 1
NormalizerBase::supportsNormalization public function Checks whether the given class is supported for normalization by this normalizer. Overrides NormalizerInterface::supportsNormalization 1
SerializerAwareNormalizer::$serializer protected property
SerializerAwareNormalizer::setSerializer public function Sets the owning Serializer object. Overrides SerializerAwareInterface::setSerializer
TypedDataNormalizer::$supportedInterfaceOrClass protected property The interface or class that this Normalizer supports. Overrides NormalizerBase::$supportedInterfaceOrClass
TypedDataNormalizer::normalize public function Normalizes an object into a set of arrays/scalars. Overrides NormalizerInterface::normalize