PHP Класс Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer

Автор: Kévin Dunglas ([email protected])
Наследование: extends AbstractNormalizer
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface $classMetadataFactory = null, Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter = null, Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface $propertyTypeExtractor = null )
denormalize ( $data, $class, $format = null, array $context = [] )
normalize ( $object, $format = null, array $context = [] )
supportsDenormalization ( $data, $type, $format = null )
supportsNormalization ( $data, $format = null )

Защищенные методы

Метод Описание
extractAttributes ( object $object, string | null $format = null, array $context = [] ) : string[] Extracts attributes to normalize from the class of the given object, format and context.
getAttributeValue ( object $object, string $attribute, string | null $format = null, array $context = [] ) : mixed Gets the attribute value.
getAttributes ( object $object, string | null $format = null, array $context ) : string[] Gets and caches attributes for the given object, format and context.
setAttributeValue ( object $object, string $attribute, mixed $value, string | null $format = null, array $context = [] ) Sets attribute value.

Приватные методы

Метод Описание
getCacheKey ( string | null $format, array $context ) : boolean | string Gets the cache key to use.
isMaxDepthReached ( array $attributesMetadata, string $class, string $attribute, array &$context ) : boolean Is the max depth reached for the given attribute?
updateData ( array $data, string $attribute, mixed $attributeValue ) : array Sets an attribute and apply the name converter if necessary.
validateAndDenormalize ( string $currentClass, string $attribute, mixed $data, string | null $format, array $context ) : mixed Validates the submitted data and denormalizes it.

Описание методов

__construct() публичный Метод

public __construct ( Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface $classMetadataFactory = null, Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter = null, Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface $propertyTypeExtractor = null )
$classMetadataFactory Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface
$nameConverter Symfony\Component\Serializer\NameConverter\NameConverterInterface
$propertyTypeExtractor Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface

denormalize() публичный Метод

public denormalize ( $data, $class, $format = null, array $context = [] )
$context array

extractAttributes() абстрактный защищенный Метод

Extracts attributes to normalize from the class of the given object, format and context.
abstract protected extractAttributes ( object $object, string | null $format = null, array $context = [] ) : string[]
$object object
$format string | null
$context array
Результат string[]

getAttributeValue() абстрактный защищенный Метод

Gets the attribute value.
abstract protected getAttributeValue ( object $object, string $attribute, string | null $format = null, array $context = [] ) : mixed
$object object
$attribute string
$format string | null
$context array
Результат mixed

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[]

normalize() публичный Метод

public normalize ( $object, $format = null, array $context = [] )
$context array

setAttributeValue() абстрактный защищенный Метод

Sets attribute value.
abstract protected setAttributeValue ( object $object, string $attribute, mixed $value, string | null $format = null, array $context = [] )
$object object
$attribute string
$value mixed
$format string | null
$context array

supportsDenormalization() публичный Метод

public supportsDenormalization ( $data, $type, $format = null )

supportsNormalization() публичный Метод

public supportsNormalization ( $data, $format = null )