You are here

class DataDefinitionEntityReferenceNormalizer in JSON:API Schema 8

Data definition normalizer.

Hierarchy

Expanded class hierarchy of DataDefinitionEntityReferenceNormalizer

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

File

src/Normalizer/DataDefinitionEntityReferenceNormalizer.php, line 10

Namespace

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

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

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

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableNormalizerInterface::SERIALIZATION_CONTEXT_CACHEABILITY constant Name of key for bubbling cacheability metadata via serialization context.
DataDefinitionEntityReferenceNormalizer::$supportedDataTypes protected property The supported data type. Overrides DataDefinitionNormalizer::$supportedDataTypes
DataDefinitionEntityReferenceNormalizer::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