You are here

class DataDefinitionStringNormalizer in JSON:API Schema 8

Data definition normalizer.

Hierarchy

Expanded class hierarchy of DataDefinitionStringNormalizer

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

File

src/Normalizer/DataDefinitionStringNormalizer.php, line 10

Namespace

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

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

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

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableNormalizerInterface::SERIALIZATION_CONTEXT_CACHEABILITY constant Name of key for bubbling cacheability metadata via serialization context.
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
DataDefinitionStringNormalizer::$supportedDataTypes protected property The supported data type. Overrides DataDefinitionNormalizer::$supportedDataTypes
DataDefinitionStringNormalizer::extractPropertyData protected function Extracts property details from a data definition. Overrides DataDefinitionNormalizer::extractPropertyData
NormalizerBase::addCacheableDependency protected function Adds cacheability if applicable.
NormalizerBase::checkFormat protected function Checks if the provided format is supported by this normalizer. 2