function ObjectNormalizer::getAttributeValue
Overrides AbstractObjectNormalizer::getAttributeValue
File
-
vendor/
symfony/ serializer/ Normalizer/ ObjectNormalizer.php, line 134
Class
- ObjectNormalizer
- Converts between objects and arrays using the PropertyAccess component.
Namespace
Symfony\Component\Serializer\NormalizerCode
protected function getAttributeValue(object $object, string $attribute, ?string $format = null, array $context = []) : mixed {
$mapping = $this->classDiscriminatorResolver?->getMappingForMappedObject($object);
return $attribute === $mapping?->getTypeProperty() ? $mapping : $this->propertyAccessor
->getValue($object, $attribute);
}