Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer::getAttributes PHP Метод

getAttributes() защищенный Метод

Gets and caches attributes for the given object, format and context.
protected getAttributes ( object $object, string | null $format = null, array $context ) : string[]
$object object
$format string | null
$context array
Результат string[]
    protected function getAttributes($object, $format = null, array $context)
    {
        $class = get_class($object);
        $key = $class . '-' . $context['cache_key'];
        if (isset($this->attributesCache[$key])) {
            return $this->attributesCache[$key];
        }
        $allowedAttributes = $this->getAllowedAttributes($object, $context, true);
        if (false !== $allowedAttributes) {
            if ($context['cache_key']) {
                $this->attributesCache[$key] = $allowedAttributes;
            }
            return $allowedAttributes;
        }
        if (isset($this->attributesCache[$class])) {
            return $this->attributesCache[$class];
        }
        return $this->attributesCache[$class] = $this->extractAttributes($object, $format, $context);
    }