Property | Type | Description | |
---|---|---|---|
$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 |
Method | Description | |
---|---|---|
buildPropertyMappingConfiguration ( string $type = PropertyMappingConfiguration::class ) : |
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. |
Method | Description | |
---|---|---|
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. |
public buildPropertyMappingConfiguration ( string $type = PropertyMappingConfiguration::class ) : |
||
$type | string | the implementation class name of the PropertyMappingConfiguration to instantiate; must be a subclass of Neos\Flow\Property\PropertyMappingConfiguration |
return |
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. |
return | mixed | an instance of $targetType |
protected determineSourceTypes ( mixed $source ) : array | ||
$source | mixed | |
return | array | Possible source types (single value for simple typed source, multiple values for object source) |
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. |
return | mixed | an instance of $targetType |
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 |
return | mixed | Either the matching object converter or NULL |
protected findTypeConverter ( mixed $source, string $targetType, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration ) : Neos\Flow\Property\TypeConverterInterface | ||
$source | mixed | |
$targetType | string | |
$configuration | Neos\Flow\Property\PropertyMappingConfigurationInterface | |
return | Neos\Flow\Property\TypeConverterInterface | Type Converter which should be used to convert between $source and $targetType. |
public getMessages ( ) : Neos\Error\Messages\Result | ||
return | Neos\Error\Messages\Result |
public static getTypeConverterImplementationClassNames ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array | ||
$objectManager | Neos\Flow\ObjectManagement\ObjectManagerInterface | |
return | array | Array of type converter implementations |
public getTypeConverters ( ) : array | ||
return | array |
public initializeObject ( ) : void | ||
return | void |
protected prepareTypeConverterMap ( ) : array | ||
return | array |
protected VariableFrontend,Neos\Cache\Frontend $cache | ||
return | Neos\Cache\Frontend\VariableFrontend |
protected Result,Neos\Error\Messages $messages | ||
return | Neos\Error\Messages\Result |
protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager | ||
return | Neos\Flow\ObjectManagement\ObjectManagerInterface |
protected array $typeConverters | ||
return | array |