getAttributeMetadata example

return $callback ? $callback($value$object$attribute$format$context) : $value;
    }

    /** * Computes the normalization context merged with current one. Metadata always wins over global context, as more specific. * * @internal */
    protected function getAttributeNormalizationContext(object $object, string $attribute, array $context): array
    {
        if (null === $metadata = $this->getAttributeMetadata($object$attribute)) {
            return $context;
        }

        return array_merge($context$metadata->getNormalizationContextForGroups($this->getGroups($context)));
    }

    /** * Computes the denormalization context merged with current one. Metadata always wins over global context, as more specific. * * @internal */
    
return $callback ? $callback($value$object$attribute$format$context) : $value;
    }

    /** * Computes the normalization context merged with current one. Metadata always wins over global context, as more specific. * * @internal */
    protected function getAttributeNormalizationContext(object $object, string $attribute, array $context): array
    {
        if (null === $metadata = $this->getAttributeMetadata($object$attribute)) {
            return $context;
        }

        return array_merge($context$metadata->getNormalizationContextForGroups($this->getGroups($context)));
    }

    /** * Computes the denormalization context merged with current one. Metadata always wins over global context, as more specific. * * @internal */
    
Home | Imprint | This part of the site doesn't use cookies.