class DataDefinitionTimestampNormalizer in JSON:API Schema 8
Data definition normalizer.
Hierarchy
- class \Drupal\serialization\Normalizer\NormalizerBase implements \Symfony\Component\Serializer\SerializerAwareInterface, CacheableNormalizerInterface uses \Symfony\Component\Serializer\SerializerAwareTrait
- class \Drupal\jsonapi_schema\Normalizer\DataDefinitionNormalizer
- class \Drupal\jsonapi_schema\Normalizer\DataDefinitionTimestampNormalizer
- class \Drupal\jsonapi_schema\Normalizer\DataDefinitionNormalizer
Expanded class hierarchy of DataDefinitionTimestampNormalizer
1 string reference to 'DataDefinitionTimestampNormalizer'
1 service uses DataDefinitionTimestampNormalizer
File
- src/
Normalizer/ DataDefinitionTimestampNormalizer.php, line 10
Namespace
Drupal\jsonapi_schema\NormalizerView source
class DataDefinitionTimestampNormalizer extends DataDefinitionNormalizer {
/**
* {@inheritdoc}
*/
protected $supportedDataTypes = [
'timestamp',
];
/**
* {@inheritdoc}
*/
protected function extractPropertyData(DataDefinitionInterface $property, array $context = []) {
$value = parent::extractPropertyData($property);
$value['type'] = 'number';
$value['format'] = 'utc-millisec';
return $value;
}
}