Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ObjectNormalizer.php

function ObjectNormalizer::setAttributeValue

Overrides AbstractObjectNormalizer::setAttributeValue

File

vendor/symfony/serializer/Normalizer/ObjectNormalizer.php, line 143

Class

ObjectNormalizer
Converts between objects and arrays using the PropertyAccess component.

Namespace

Symfony\Component\Serializer\Normalizer

Code

protected function setAttributeValue(object $object, string $attribute, mixed $value, ?string $format = null, array $context = []) : void {
    try {
        $this->propertyAccessor
            ->setValue($object, $attribute, $value);
    } catch (NoSuchPropertyException) {
        // Properties not found are ignored
    }
}
RSS feed
Powered by Drupal