Property | Type | Description | |
---|---|---|---|
$callbacks | array | ||
$camelizedAttributes | array | ||
$circularReferenceHandler | callable | ||
$circularReferenceLimit | integer | ||
$classMetadataFactory | Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface | null | ||
$ignoredAttributes | array | ||
$nameConverter | Symfony\Component\Serializer\NameConverter\NameConverterInterface | null |
Method | Description | |
---|---|---|
__construct ( Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface $classMetadataFactory = null, Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter = null ) | Sets the {@link ClassMetadataFactoryInterface} to use. | |
setCallbacks ( array $callbacks ) : self | Set normalization callbacks. | |
setCircularReferenceHandler ( callable $circularReferenceHandler ) : self | Set circular reference handler. | |
setCircularReferenceLimit ( integer $circularReferenceLimit ) : self | Set circular reference limit. | |
setIgnoredAttributes ( array $ignoredAttributes ) : self | Set ignored attributes for normalization and denormalization. |
Method | Description | |
---|---|---|
getAllowedAttributes ( string | object $classOrObject, array $context, boolean $attributesAsString = false ) : string[] | Symfony\Component\Serializer\Mapping\AttributeMetadataInterface[] | boolean | Gets attributes to normalize using groups. | |
getConstructor ( array &$data, string $class, array &$context, ReflectionClass $reflectionClass, array | boolean $allowedAttributes ) : ReflectionMethod | null | Returns the method to use to construct an object. This method must be either the object constructor or static. | |
handleCircularReference ( object $object ) : mixed | Handles a circular reference. | |
instantiateObject ( array &$data, string $class, array &$context, ReflectionClass $reflectionClass, array | boolean $allowedAttributes ) : object | Instantiates an object using constructor parameters when needed. | |
isAllowedAttribute ( object | string $classOrObject, string $attribute, string | null $format = null, array $context = [] ) : boolean | Is this attribute allowed? | |
isCircularReference ( object $object, array &$context ) : boolean | Detects if the configured circular reference limit is reached. | |
prepareForDenormalization ( object | array $data ) : array | Normalizes the given data to an array. It's particularly useful during the denormalization process. |
public __construct ( Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface $classMetadataFactory = null, Symfony\Component\Serializer\NameConverter\NameConverterInterface $nameConverter = null ) | ||
$classMetadataFactory | Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface | |
$nameConverter | Symfony\Component\Serializer\NameConverter\NameConverterInterface |
protected getAllowedAttributes ( string | object $classOrObject, array $context, boolean $attributesAsString = false ) : string[] | Symfony\Component\Serializer\Mapping\AttributeMetadataInterface[] | boolean | ||
$classOrObject | string | object | |
$context | array | |
$attributesAsString | boolean | If false, return an array of {@link AttributeMetadataInterface} |
return | string[] | Symfony\Component\Serializer\Mapping\AttributeMetadataInterface[] | boolean |
protected getConstructor ( array &$data, string $class, array &$context, ReflectionClass $reflectionClass, array | boolean $allowedAttributes ) : ReflectionMethod | null | ||
$data | array | |
$class | string | |
$context | array | |
$reflectionClass | ReflectionClass | |
$allowedAttributes | array | boolean | |
return | ReflectionMethod | null |
protected handleCircularReference ( object $object ) : mixed | ||
$object | object | |
return | mixed |
public setCallbacks ( array $callbacks ) : self | ||
$callbacks | array | help normalize the result |
return | self |
public setCircularReferenceHandler ( callable $circularReferenceHandler ) : self | ||
$circularReferenceHandler | callable | |
return | self |
public setCircularReferenceLimit ( integer $circularReferenceLimit ) : self | ||
$circularReferenceLimit | integer | limit of iterations for the same object |
return | self |
public setIgnoredAttributes ( array $ignoredAttributes ) : self | ||
$ignoredAttributes | array | |
return | self |
protected callable $circularReferenceHandler | ||
return | callable |
protected ClassMetadataFactoryInterface,Symfony\Component\Serializer\Mapping\Factory|null $classMetadataFactory | ||
return | Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface | null |
protected NameConverterInterface,Symfony\Component\Serializer\NameConverter|null $nameConverter | ||
return | Symfony\Component\Serializer\NameConverter\NameConverterInterface | null |