public convertFrom ( mixed $source, string $targetType, array $convertedChildProperties = [], Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : mixed | Neos\Error\Messages\Error | ||
$source | mixed | |
$targetType | string | |
$convertedChildProperties | array | |
$configuration | Neos\Flow\Property\PropertyMappingConfigurationInterface | |
return | mixed | Neos\Error\Messages\Error | the target type, or an error object if a user-error occurred |
public function convertFrom($source, $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)
{
$result = [];
$convertElements = $configuration->getConfigurationValue(ArrayTypeConverter::class, self::CONFIGURATION_CONVERT_ELEMENTS);
foreach ($source as $element) {
if ($convertElements === true) {
$element = $this->propertyMapper->convert($element, 'array', $configuration);
}
$result[] = $element;
}
return $result;
}