PHP 클래스 Symfony\Component\Serializer\Normalizer\AbstractNormalizer

저자: Kévin Dunglas ([email protected])
상속: extends Symfony\Component\Serializer\Normalizer\SerializerAwareNormalizer, implements Symfony\Component\Serializer\Normalizer\NormalizerInterface, implements Symfony\Component\Serializer\Normalizer\DenormalizerInterface
파일 보기 프로젝트 열기: symfony/symfony 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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

공개 메소드들

메소드 설명
__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.

보호된 메소드들

메소드 설명
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.

메소드 상세

__construct() 공개 메소드

Sets the {@link ClassMetadataFactoryInterface} to use.
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

getAllowedAttributes() 보호된 메소드

Gets attributes to normalize using groups.
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}
리턴 string[] | Symfony\Component\Serializer\Mapping\AttributeMetadataInterface[] | boolean

getConstructor() 보호된 메소드

Returns the method to use to construct an object. This method must be either the object constructor or static.
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
리턴 ReflectionMethod | null

handleCircularReference() 보호된 메소드

If a circular reference handler is set, it will be called. Otherwise, a {@class CircularReferenceException} will be thrown.
protected handleCircularReference ( object $object ) : mixed
$object object
리턴 mixed

instantiateObject() 보호된 메소드

This method also allows to denormalize data into an existing object if it is present in the context with the object_to_populate. This object is removed from the context before being returned to avoid side effects when recursively normalizing an object graph.
protected instantiateObject ( array &$data, string $class, array &$context, ReflectionClass $reflectionClass, array | boolean $allowedAttributes ) : object
$data array
$class string
$context array
$reflectionClass ReflectionClass
$allowedAttributes array | boolean
리턴 object

isAllowedAttribute() 보호된 메소드

Is this attribute allowed?
protected isAllowedAttribute ( object | string $classOrObject, string $attribute, string | null $format = null, array $context = [] ) : boolean
$classOrObject object | string
$attribute string
$format string | null
$context array
리턴 boolean

isCircularReference() 보호된 메소드

Detects if the configured circular reference limit is reached.
protected isCircularReference ( object $object, array &$context ) : boolean
$object object
$context array
리턴 boolean

prepareForDenormalization() 보호된 메소드

Normalizes the given data to an array. It's particularly useful during the denormalization process.
protected prepareForDenormalization ( object | array $data ) : array
$data object | array
리턴 array

setCallbacks() 공개 메소드

Set normalization callbacks.
public setCallbacks ( array $callbacks ) : self
$callbacks array help normalize the result
리턴 self

setCircularReferenceHandler() 공개 메소드

Set circular reference handler.
public setCircularReferenceHandler ( callable $circularReferenceHandler ) : self
$circularReferenceHandler callable
리턴 self

setCircularReferenceLimit() 공개 메소드

Set circular reference limit.
public setCircularReferenceLimit ( integer $circularReferenceLimit ) : self
$circularReferenceLimit integer limit of iterations for the same object
리턴 self

setIgnoredAttributes() 공개 메소드

Set ignored attributes for normalization and denormalization.
public setIgnoredAttributes ( array $ignoredAttributes ) : self
$ignoredAttributes array
리턴 self

프로퍼티 상세

$callbacks 보호되어 있는 프로퍼티

protected array $callbacks
리턴 array

$camelizedAttributes 보호되어 있는 프로퍼티

protected array $camelizedAttributes
리턴 array

$circularReferenceHandler 보호되어 있는 프로퍼티

protected callable $circularReferenceHandler
리턴 callable

$circularReferenceLimit 보호되어 있는 프로퍼티

protected int $circularReferenceLimit
리턴 integer

$classMetadataFactory 보호되어 있는 프로퍼티

protected ClassMetadataFactoryInterface,Symfony\Component\Serializer\Mapping\Factory|null $classMetadataFactory
리턴 Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface | null

$ignoredAttributes 보호되어 있는 프로퍼티

protected array $ignoredAttributes
리턴 array

$nameConverter 보호되어 있는 프로퍼티

protected NameConverterInterface,Symfony\Component\Serializer\NameConverter|null $nameConverter
리턴 Symfony\Component\Serializer\NameConverter\NameConverterInterface | null