function FieldableEntityNormalizerTrait::determineEntityTypeId
Same name in other branches
- 9 core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php \Drupal\serialization\Normalizer\FieldableEntityNormalizerTrait::determineEntityTypeId()
- 8.9.x core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php \Drupal\serialization\Normalizer\FieldableEntityNormalizerTrait::determineEntityTypeId()
- 10 core/modules/serialization/src/Normalizer/FieldableEntityNormalizerTrait.php \Drupal\serialization\Normalizer\FieldableEntityNormalizerTrait::determineEntityTypeId()
Determines the entity type ID to denormalize as.
Parameters
string $class: The entity type class to be denormalized to.
array $context: The serialization context data.
Return value
string The entity type ID.
1 call to FieldableEntityNormalizerTrait::determineEntityTypeId()
- EntityNormalizer::denormalize in core/
modules/ serialization/ src/ Normalizer/ EntityNormalizer.php
File
-
core/
modules/ serialization/ src/ Normalizer/ FieldableEntityNormalizerTrait.php, line 52
Class
- FieldableEntityNormalizerTrait
- A trait for providing fieldable entity normalization/denormalization methods.
Namespace
Drupal\serialization\NormalizerCode
protected function determineEntityTypeId($class, $context) {
// Get the entity type ID while letting context override the $class param.
return !empty($context['entity_type']) ? $context['entity_type'] : $this->getEntityTypeRepository()
->getEntityTypeFromClass($class);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.