validateAndDenormalize example

if ($attributeContext[self::DEEP_OBJECT_TO_POPULATE] ?? $this->defaultContext[self::DEEP_OBJECT_TO_POPULATE] ?? false) {
                try {
                    $attributeContext[self::OBJECT_TO_POPULATE] = $this->getAttributeValue($object$attribute$format$attributeContext);
                } catch (NoSuchPropertyException) {
                }
            }

            $types = $this->getTypes($resolvedClass$attribute);

            if (null !== $types) {
                try {
                    $value = $this->validateAndDenormalize($types$resolvedClass$attribute$value$format$attributeContext);
                } catch (NotNormalizableValueException $exception) {
                    if (isset($context['not_normalizable_value_exceptions'])) {
                        $context['not_normalizable_value_exceptions'][] = $exception;
                        continue;
                    }
                    throw $exception;
                }
            }

            $value = $this->applyCallbacks($value$resolvedClass$attribute$format$attributeContext);

            
if ($attributeContext[self::DEEP_OBJECT_TO_POPULATE] ?? $this->defaultContext[self::DEEP_OBJECT_TO_POPULATE] ?? false) {
                try {
                    $attributeContext[self::OBJECT_TO_POPULATE] = $this->getAttributeValue($object$attribute$format$attributeContext);
                } catch (NoSuchPropertyException) {
                }
            }

            $types = $this->getTypes($resolvedClass$attribute);

            if (null !== $types) {
                try {
                    $value = $this->validateAndDenormalize($types$resolvedClass$attribute$value$format$attributeContext);
                } catch (NotNormalizableValueException $exception) {
                    if (isset($context['not_normalizable_value_exceptions'])) {
                        $context['not_normalizable_value_exceptions'][] = $exception;
                        continue;
                    }
                    throw $exception;
                }
            }

            $value = $this->applyCallbacks($value$resolvedClass$attribute$format$attributeContext);

            
Home | Imprint | This part of the site doesn't use cookies.