You are here

public function TimestampNormalizer::denormalize in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/serialization/src/Normalizer/TimestampNormalizer.php \Drupal\serialization\Normalizer\TimestampNormalizer::denormalize()
  2. 9 core/modules/serialization/src/Normalizer/TimestampNormalizer.php \Drupal\serialization\Normalizer\TimestampNormalizer::denormalize()

File

core/modules/serialization/src/Normalizer/TimestampNormalizer.php, line 42

Class

TimestampNormalizer
Converts values for the Timestamp data type to and from common formats.

Namespace

Drupal\serialization\Normalizer

Code

public function denormalize($data, $class, $format = NULL, array $context = []) : mixed {
  $denormalized = parent::denormalize($data, $class, $format, $context);
  return $denormalized
    ->getTimestamp();
}