public function convertFrom($source, $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)
{
$object = $this->buildObject($convertedChildProperties, $targetType);
foreach ($convertedChildProperties as $propertyName => $propertyValue) {
$result = ObjectAccess::setProperty($object, $propertyName, $propertyValue);
if ($result === false) {
$exceptionMessage = sprintf('Property "%s" having a value of type "%s" could not be set in target object of type "%s". Make sure that the property is accessible properly, for example via an appropriate setter method.', $propertyName, is_object($propertyValue) ? get_class($propertyValue) : gettype($propertyValue), $targetType);
throw new InvalidTargetException($exceptionMessage, 1304538165);
}
}
return $object;
}