PHP 클래스 Neos\Flow\Property\TypeConverter\ObjectConverter

This converter will only be used on target types that are not entities or value objects (for those the PersistentObjectConverter is used). The target type can be overridden in the source by setting the __type key to the desired value. The converter will return an instance of the target type with all properties given in the source array set to the respective values. For the mechanics used to set the values see ObjectAccess::setProperty().
상속: extends AbstractTypeConverter
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$constructorReflectionFirstLevelCache array As it is very likely that the constructor arguments are needed twice we should cache them for the request.
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$priority integer
$reflectionService Neos\Flow\Reflection\ReflectionService
$sourceTypes array
$targetType string

공개 메소드들

메소드 설명
canConvertFrom ( mixed $source, string $targetType ) : boolean Only convert non-persistent types
convertFrom ( mixed $source, string $targetType, array $convertedChildProperties = [], Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : object Convert an object from $source to an object.
getSourceChildPropertiesToBeConverted ( mixed $source ) : array Convert all properties in the source array
getTargetTypeForSource ( mixed $source, string $originalTargetType, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : string Determines the target type based on the source's (optional) __type key.
getTypeOfChildProperty ( string $targetType, string $propertyName, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration ) : string The type of a property is determined by the reflection service.

보호된 메소드들

메소드 설명
buildObject ( array &$possibleConstructorArgumentValues, string $objectType ) : object Builds a new instance of $objectType with the given $possibleConstructorArgumentValues.
getConstructorArgumentsForClass ( string $className ) : array Get the constructor argument reflection for the given object type.

메소드 상세

buildObject() 보호된 메소드

If constructor argument values are missing from the given array the method looks for a default value in the constructor signature. Furthermore, the constructor arguments are removed from $possibleConstructorArgumentValues
protected buildObject ( array &$possibleConstructorArgumentValues, string $objectType ) : object
$possibleConstructorArgumentValues array
$objectType string
리턴 object The created instance

canConvertFrom() 공개 메소드

Only convert non-persistent types
public canConvertFrom ( mixed $source, string $targetType ) : boolean
$source mixed
$targetType string
리턴 boolean

convertFrom() 공개 메소드

Convert an object from $source to an object.
public convertFrom ( mixed $source, string $targetType, array $convertedChildProperties = [], Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : object
$source mixed
$targetType string
$convertedChildProperties array
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
리턴 object the target type

getConstructorArgumentsForClass() 보호된 메소드

Get the constructor argument reflection for the given object type.
protected getConstructorArgumentsForClass ( string $className ) : array
$className string
리턴 array

getSourceChildPropertiesToBeConverted() 공개 메소드

Convert all properties in the source array
public getSourceChildPropertiesToBeConverted ( mixed $source ) : array
$source mixed
리턴 array

getTargetTypeForSource() 공개 메소드

Determines the target type based on the source's (optional) __type key.
public getTargetTypeForSource ( mixed $source, string $originalTargetType, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : string
$source mixed
$originalTargetType string
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
리턴 string

getTypeOfChildProperty() 공개 메소드

The type of a property is determined by the reflection service.
public getTypeOfChildProperty ( string $targetType, string $propertyName, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration ) : string
$targetType string
$propertyName string
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
리턴 string

프로퍼티 상세

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

As it is very likely that the constructor arguments are needed twice we should cache them for the request.
protected array $constructorReflectionFirstLevelCache
리턴 array

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

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
리턴 Neos\Flow\ObjectManagement\ObjectManagerInterface

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

protected int $priority
리턴 integer

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

protected ReflectionService,Neos\Flow\Reflection $reflectionService
리턴 Neos\Flow\Reflection\ReflectionService

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

protected array $sourceTypes
리턴 array

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

protected string $targetType
리턴 string