PHP 클래스 Neos\Flow\Property\PropertyMapper

It is used most prominently to map incoming HTTP arguments to objects.
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cache Neos\Cache\Frontend\VariableFrontend
$messages Neos\Error\Messages\Result A list of property mapping messages (errors, warnings) which have occured on last mapping.
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$typeConverters array It has the following structure: 1. Dimension: Source Type 2. Dimension: Target Type 3. Dimension: Priority Value: Type Converter instance

공개 메소드들

메소드 설명
buildPropertyMappingConfiguration ( string $type = PropertyMappingConfiguration::class ) : PropertyMappingConfiguration Builds the default property mapping configuration.
convert ( mixed $source, string $targetType, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : mixed Map $source to $targetType, and return the result.
getMessages ( ) : Neos\Error\Messages\Result Get the messages of the last Property Mapping
getTypeConverterImplementationClassNames ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array Returns all class names implementing the TypeConverterInterface.
getTypeConverters ( ) : array Returns a multi-dimensional array with the Type Converters available in the system.
initializeObject ( ) : void Lifecycle method, called after all dependencies have been injected.

보호된 메소드들

메소드 설명
determineSourceTypes ( mixed $source ) : array Determine the type of the source data, or throw an exception if source was an unsupported format.
doMapping ( mixed $source, string $targetType, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration, array &$currentPropertyPath ) : mixed Internal function which actually does the property mapping.
findEligibleConverterWithHighestPriority ( mixed $converters, mixed $source, string $targetType ) : mixed
findFirstEligibleTypeConverterInObjectHierarchy ( string $source, string $sourceType, string $targetType ) : mixed Tries to find a suitable type converter for the given source and target type.
findTypeConverter ( mixed $source, string $targetType, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration ) : Neos\Flow\Property\TypeConverterInterface Determine the type converter to be used. If no converter has been found, an exception is raised.
getConvertersForInterfaces ( array $convertersForSource, array $interfaceNames ) : array
prepareTypeConverterMap ( ) : array Collects all TypeConverter implementations in a multi-dimensional array with source and target types.

메소드 상세

buildPropertyMappingConfiguration() 공개 메소드

Builds the default property mapping configuration.
public buildPropertyMappingConfiguration ( string $type = PropertyMappingConfiguration::class ) : PropertyMappingConfiguration
$type string the implementation class name of the PropertyMappingConfiguration to instantiate; must be a subclass of Neos\Flow\Property\PropertyMappingConfiguration
리턴 PropertyMappingConfiguration

convert() 공개 메소드

If $source is an object and already is of type $targetType, we do return the unmodified object.
public convert ( mixed $source, string $targetType, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : mixed
$source mixed the source data to map. MUST be a simple type, NO object allowed!
$targetType string The type of the target; can be either a class name or a simple type.
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface Configuration for the property mapping. If NULL, the PropertyMappingConfigurationBuilder will create a default configuration.
리턴 mixed an instance of $targetType

determineSourceTypes() 보호된 메소드

Determine the type of the source data, or throw an exception if source was an unsupported format.
protected determineSourceTypes ( mixed $source ) : array
$source mixed
리턴 array Possible source types (single value for simple typed source, multiple values for object source)

doMapping() 보호된 메소드

Internal function which actually does the property mapping.
protected doMapping ( mixed $source, string $targetType, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration, array &$currentPropertyPath ) : mixed
$source mixed the source data to map. MUST be a simple type, NO object allowed!
$targetType string The type of the target; can be either a class name or a simple type.
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface Configuration for the property mapping.
$currentPropertyPath array The property path currently being mapped; used for knowing the context in case an exception is thrown.
리턴 mixed an instance of $targetType

findEligibleConverterWithHighestPriority() 보호된 메소드

protected findEligibleConverterWithHighestPriority ( mixed $converters, mixed $source, string $targetType ) : mixed
$converters mixed
$source mixed
$targetType string
리턴 mixed Either the matching object converter or NULL

findFirstEligibleTypeConverterInObjectHierarchy() 보호된 메소드

Tries to find a suitable type converter for the given source and target type.
protected findFirstEligibleTypeConverterInObjectHierarchy ( string $source, string $sourceType, string $targetType ) : mixed
$source string The actual source value
$sourceType string Type of the source to convert from
$targetType string Name of the target type to find a type converter for
리턴 mixed Either the matching object converter or NULL

findTypeConverter() 보호된 메소드

Determine the type converter to be used. If no converter has been found, an exception is raised.
protected findTypeConverter ( mixed $source, string $targetType, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration ) : Neos\Flow\Property\TypeConverterInterface
$source mixed
$targetType string
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
리턴 Neos\Flow\Property\TypeConverterInterface Type Converter which should be used to convert between $source and $targetType.

getConvertersForInterfaces() 보호된 메소드

protected getConvertersForInterfaces ( array $convertersForSource, array $interfaceNames ) : array
$convertersForSource array
$interfaceNames array
리턴 array

getMessages() 공개 메소드

Get the messages of the last Property Mapping
public getMessages ( ) : Neos\Error\Messages\Result
리턴 Neos\Error\Messages\Result

getTypeConverterImplementationClassNames() 공개 정적인 메소드

Returns all class names implementing the TypeConverterInterface.
public static getTypeConverterImplementationClassNames ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
리턴 array Array of type converter implementations

getTypeConverters() 공개 메소드

It has the following structure: 1. Dimension: Source Type 2. Dimension: Target Type 3. Dimension: Priority Value: Type Converter instance
public getTypeConverters ( ) : array
리턴 array

initializeObject() 공개 메소드

Here, the typeConverter array gets initialized.
public initializeObject ( ) : void
리턴 void

prepareTypeConverterMap() 보호된 메소드

Collects all TypeConverter implementations in a multi-dimensional array with source and target types.
또한 보기: getTypeConverters
protected prepareTypeConverterMap ( ) : array
리턴 array

프로퍼티 상세

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

protected VariableFrontend,Neos\Cache\Frontend $cache
리턴 Neos\Cache\Frontend\VariableFrontend

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

A list of property mapping messages (errors, warnings) which have occured on last mapping.
protected Result,Neos\Error\Messages $messages
리턴 Neos\Error\Messages\Result

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

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

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

It has the following structure: 1. Dimension: Source Type 2. Dimension: Target Type 3. Dimension: Priority Value: Type Converter instance
protected array $typeConverters
리턴 array