PHP Класс ApiPlatform\Core\Serializer\AbstractItemNormalizer

Автор: Kévin Dunglas ([email protected])
Наследование: extends Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer, use trait ContextTrait
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$iriConverter
$propertyAccessor
$propertyMetadataFactory
$propertyNameCollectionFactory
$resourceClassResolver

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

Метод Описание
__construct ( ApiPlatform\Core\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory, ApiPlatform\Core\Api\IriConverterInterface $iriConverter, ApiPlatform\Core\Api\ResourceClassResolverInterface $resourceClassResolver, Symfony\Component\PropertyAccess\PropertyAccessorInterface $propertyAccessor = null, Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter = null )
denormalize ( $data, $class, $format = null, array $context = [] )
normalize ( $object, $format = null, array $context = [] )
supportsDenormalization ( $data, $type, $format = null )
supportsNormalization ( $data, $format = null )

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

Метод Описание
createRelationSerializationContext ( string $resourceClass, array $context ) : array Creates the context to use when serializing a relation.
extractAttributes ( $object, $format = null, array $context = [] )
getAllowedAttributes ( $classOrObject, array $context, $attributesAsString = false )
getAttributeValue ( $object, $attribute, $format = null, array $context = [] )
getFactoryOptions ( array $context ) : array Gets a valid context for property metadata factories.
setAttributeValue ( $object, $attribute, $value, $format = null, array $context = [] )
validateType ( string $attribute, Symfony\Component\PropertyInfo\Type $type, mixed $value, string $format = null ) Validates the type of the value. Allows using integers as floats for JSON formats.

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

Метод Описание
denormalizeCollection ( string $attribute, PropertyMetadata $propertyMetadata, Symfony\Component\PropertyInfo\Type $type, string $className, mixed $value, string $format = null, array $context ) : array Denormalizes a collection of objects.
denormalizeRelation ( string $attributeName, PropertyMetadata $propertyMetadata, string $className, mixed $value, string $format = null, array $context ) : object | null Denormalizes a relation.
normalizeRelation ( PropertyMetadata $propertyMetadata, mixed $relatedObject, string $resourceClass, string $format = null, array $context ) : string | array Normalizes a relation as an URI if is a Link or as a JSON-LD object.
setValue ( object $object, string $attributeName, mixed $value ) Sets a value of the object using the PropertyAccess component.

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

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

public __construct ( ApiPlatform\Core\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface $propertyMetadataFactory, ApiPlatform\Core\Api\IriConverterInterface $iriConverter, ApiPlatform\Core\Api\ResourceClassResolverInterface $resourceClassResolver, Symfony\Component\PropertyAccess\PropertyAccessorInterface $propertyAccessor = null, Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter = null )
$propertyNameCollectionFactory ApiPlatform\Core\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface
$propertyMetadataFactory ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface
$iriConverter ApiPlatform\Core\Api\IriConverterInterface
$resourceClassResolver ApiPlatform\Core\Api\ResourceClassResolverInterface
$propertyAccessor Symfony\Component\PropertyAccess\PropertyAccessorInterface
$nameConverter Symfony\Component\Serializer\NameConverter\NameConverterInterface

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

Creates the context to use when serializing a relation.
protected createRelationSerializationContext ( string $resourceClass, array $context ) : array
$resourceClass string
$context array
Результат array

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

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

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

Unused in this context.
protected extractAttributes ( $object, $format = null, array $context = [] )
$context array

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

protected getAllowedAttributes ( $classOrObject, array $context, $attributesAsString = false )
$context array

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

protected getAttributeValue ( $object, $attribute, $format = null, array $context = [] )
$context array

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

Gets a valid context for property metadata factories.
См. также: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/PropertyInfo/Extractor/SerializerExtractor.php
protected getFactoryOptions ( array $context ) : array
$context array
Результат array

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

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

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

protected setAttributeValue ( $object, $attribute, $value, $format = null, array $context = [] )
$context array

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

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

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

public supportsNormalization ( $data, $format = null )

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

Validates the type of the value. Allows using integers as floats for JSON formats.
protected validateType ( string $attribute, Symfony\Component\PropertyInfo\Type $type, mixed $value, string $format = null )
$attribute string
$type Symfony\Component\PropertyInfo\Type
$value mixed
$format string

Описание свойств

$iriConverter защищенное свойство

protected $iriConverter

$propertyAccessor защищенное свойство

protected $propertyAccessor

$propertyMetadataFactory защищенное свойство

protected $propertyMetadataFactory

$propertyNameCollectionFactory защищенное свойство

protected $propertyNameCollectionFactory

$resourceClassResolver защищенное свойство

protected $resourceClassResolver