You are here

class DataNormalizer in REST Views 2.0.x

Same name and namespace in other branches
  1. 8 src/Normalizer/DataNormalizer.php \Drupal\rest_views\Normalizer\DataNormalizer

Unwrap a SerializedData object and normalize the data inside.

Hierarchy

Expanded class hierarchy of DataNormalizer

See also

\Drupal\rest_views\SerializedData

1 file declares its use of DataNormalizer
EntityFieldExportTest.php in tests/src/Unit/EntityFieldExportTest.php
1 string reference to 'DataNormalizer'
rest_views.services.yml in ./rest_views.services.yml
rest_views.services.yml
1 service uses DataNormalizer
serializer.normalizer.serialized in ./rest_views.services.yml
Drupal\rest_views\Normalizer\DataNormalizer

File

src/Normalizer/DataNormalizer.php, line 13

Namespace

Drupal\rest_views\Normalizer
View source
class DataNormalizer extends NormalizerBase {

  /**
   * The interface or class that this Normalizer supports.
   *
   * @var array
   */
  protected $supportedInterfaceOrClass = [
    SerializedData::class,
  ];

  /**
   * {@inheritdoc}
   */
  public function normalize($object, $format = NULL, array $context = []) {

    /** @var \Drupal\rest_views\SerializedData $object */

    /** @var \Symfony\Component\Serializer\Normalizer\NormalizerInterface $normalizer */
    $normalizer = $this->serializer;
    return $normalizer
      ->normalize($object
      ->getData());
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableNormalizerInterface::SERIALIZATION_CONTEXT_CACHEABILITY constant Name of key for bubbling cacheability metadata via serialization context.
DataNormalizer::$supportedInterfaceOrClass protected property The interface or class that this Normalizer supports. Overrides NormalizerBase::$supportedInterfaceOrClass
DataNormalizer::normalize public function
NormalizerBase::$format protected property List of formats which supports (de-)normalization. 3
NormalizerBase::addCacheableDependency protected function Adds cacheability if applicable.
NormalizerBase::checkFormat protected function Checks if the provided format is supported by this normalizer. 1
NormalizerBase::supportsDenormalization public function Implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface::supportsDenormalization() 1
NormalizerBase::supportsNormalization public function 1