You are here

class DataDefinitionDatetimeNormalizer in JSON:API Schema 8

Data definition normalizer.

Hierarchy

Expanded class hierarchy of DataDefinitionDatetimeNormalizer

1 string reference to 'DataDefinitionDatetimeNormalizer'
jsonapi_schema.services.yml in ./jsonapi_schema.services.yml
jsonapi_schema.services.yml
1 service uses DataDefinitionDatetimeNormalizer
serializer.normalizer.data_definition.schema_json.datetime_iso8601 in ./jsonapi_schema.services.yml
Drupal\jsonapi_schema\Normalizer\DataDefinitionDatetimeNormalizer

File

src/Normalizer/DataDefinitionDatetimeNormalizer.php, line 10

Namespace

Drupal\jsonapi_schema\Normalizer
View source
class DataDefinitionDatetimeNormalizer extends DataDefinitionNormalizer {

  /**
   * {@inheritdoc}
   */
  protected $supportedDataTypes = [
    'datetime_iso8601',
  ];

  /**
   * {@inheritdoc}
   */
  protected function extractPropertyData(DataDefinitionInterface $property, array $context = []) {
    $value = parent::extractPropertyData($property);
    $value['type'] = 'string';
    $value['format'] = 'date';
    return $value;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableNormalizerInterface::SERIALIZATION_CONTEXT_CACHEABILITY constant Name of key for bubbling cacheability metadata via serialization context.
DataDefinitionDatetimeNormalizer::$supportedDataTypes protected property The supported data type. Overrides DataDefinitionNormalizer::$supportedDataTypes
DataDefinitionDatetimeNormalizer::extractPropertyData protected function Extracts property details from a data definition. Overrides DataDefinitionNormalizer::extractPropertyData
DataDefinitionNormalizer::$format protected property The formats that the Normalizer can handle. Overrides NormalizerBase::$format
DataDefinitionNormalizer::$supportedInterfaceOrClass protected property The interface or class that this Normalizer supports. Overrides NormalizerBase::$supportedInterfaceOrClass 2
DataDefinitionNormalizer::denormalize public function
DataDefinitionNormalizer::JSON_TYPES constant
DataDefinitionNormalizer::normalize public function 2
DataDefinitionNormalizer::normalizeProperties protected function Normalize an array of data definitions.
DataDefinitionNormalizer::requiredProperty protected function Determine if the given property is a required element of the schema.
DataDefinitionNormalizer::supportsDenormalization public function Implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface::supportsDenormalization() Overrides NormalizerBase::supportsDenormalization
DataDefinitionNormalizer::supportsNormalization public function Checks whether the given class is supported for normalization by this normalizer. Overrides NormalizerBase::supportsNormalization 1
NormalizerBase::addCacheableDependency protected function Adds cacheability if applicable.
NormalizerBase::checkFormat protected function Checks if the provided format is supported by this normalizer. 2