function PropertyNormalizer::setAttributeValue
Overrides AbstractObjectNormalizer::setAttributeValue
File
-
vendor/
symfony/ serializer/ Normalizer/ PropertyNormalizer.php, line 172
Class
- PropertyNormalizer
- Converts between objects and arrays by mapping properties.
Namespace
Symfony\Component\Serializer\NormalizerCode
protected function setAttributeValue(object $object, string $attribute, mixed $value, ?string $format = null, array $context = []) : void {
try {
$reflectionProperty = $this->getReflectionProperty($object, $attribute);
} catch (\ReflectionException) {
return;
}
if ($reflectionProperty->isStatic()) {
return;
}
$reflectionProperty->setValue($object, $value);
}