Converts the given source object to an array containing the type and identity.

@param object $source
@param string $targetType
@param array $convertedChildProperties
@param PropertyMappingConfigurationInterface $configuration
@return array
961994
public function convertFrom($source, $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)
    {
        return [
            '__identity' => $this->persistenceManager->getIdentifierByObject($source),
            '__type' => TypeHandling::getTypeForValue($source)
        ];
    }
246616
static <T> TypeInfoImpl<T> typeInfoFor(T source, Class<T> sourceType,
      InheritingConfiguration configuration) {
    if (configuration.valueAccessStore.getFirstSupportedReader(sourceType) != null)
      return new TypeInfoImpl<T>(source, sourceType, configuration);
    return typeInfoFor(sourceType, configuration);
  }
50362
private function createMapping(AbstractTable $source, AbstractTable $target)
    {
        $mapping = [];
        foreach ($target->getColumns() as $name => $column) {
            if ($source->hasColumn($name)) {
                $mapping[$name] = $column->getName();
            }
        }

        return $mapping;
    }
71731
public function getTypeOfChildProperty($targetType, $propertyName, PropertyMappingConfigurationInterface $configuration)
    {
        $specificTargetType = $this->objectContainer->getImplementationClassName($targetType);

        if (Core::get()->classExists($specificTargetType)) {
            $propertyTags = $this->reflectionService->getPropertyTagValues($specificTargetType, $propertyName, 'var');

            if (!empty($propertyTags)) {
                return current($propertyTags);
            }
        }

        return parent::getTypeOfChildProperty($targetType, $propertyName, $configuration);
    }
807441
public boolean canConvert(Class<?> sourceType, Class<?> targetType) {
		Assert.notNull(targetType, "targetType to convert to cannot be null");
		return canConvert((sourceType != null ? TypeDescriptor.valueOf(sourceType) : null),
				TypeDescriptor.valueOf(targetType));
	}
476558
@Override
  public <S, T> Convert<S, T> converter(Class<S> source, Class<T> target)
  {
    ConvertFrom<S> convertType = getOrCreate(source);
    
    return convertType.converter(target);
  }
168989
public function cloneProperties($target, $source)
    {
        $this->validaObjects($target, $source);

        $reflection = new \ReflectionClass($target);
        foreach ($reflection->getProperties() as $property) {

            $this->propertyAccessor->setValue(
                $target,
                $property->getName(),
                $this->propertyAccessor->getValue($source, $property->getName())
            );
        }
    }
706925
public function getSourceChildPropertiesToBeConverted($source)
    {
        if (is_string($source)) {
            return [];
        }
        if (isset($source['__identity'])) {
            unset($source['__identity']);
        }
        return parent::getSourceChildPropertiesToBeConverted($source);
    }
254703
public function canConvertFrom($source, $targetType)
    {
        if (!is_subclass_of($targetType, $this->targetType)) {
            return false;
        }
        if (is_array($source) && !isset($source['__identity'])) {
            return false;
        }
        return true;
    }
555840
public function map($source, &$target)
    {
        $source = static::makeSource($source);
        $writer = static::makeWriter($target);

        foreach ($this->fields as $field) {
            try {
                $writer::set($target, $field->getName(), $field->getDefinition()->getValue($source));
            } catch (SourceFieldMissingException $e) {
                if ($this->ignoreAllMissing) {
                    continue;
                }
                throw $e;
            } catch (IgnoreFieldException $e) {
                continue;
            }
        }
    }
784677
public static ConversionType getConversionType(final Field destination, final Field source){
		return getConversionType(destination.getType(),source.getType());
	}
1027045
public function canConvertFrom($source, $targetType)
    {
        if (!is_array($source) || !array_key_exists('data', $source)) {
            return false;
        }

        return is_null($source['data']) ?: $this->hasOnlyIdentifierProperties($source['data']);
    }
452169
public function getSourceChildPropertiesToBeConverted($source)
    {
        $gettableProperties = ObjectAccess::getGettableProperties($source);
        $propertiesToConvert = [];
        foreach ($gettableProperties as $propertyName => $gettableProperty) {
            if (is_object($gettableProperty)) {
                $propertiesToConvert[$propertyName] = $gettableProperty;
            }
        }

        return $propertiesToConvert;
    }
1080506
public static <SOURCE, TARGET> PropertyCopier<SOURCE, TARGET> getInstance(Typed<SOURCE> sourceType,
        Typed<TARGET> targetType, Mapping mapping, Matching matching) {
        return new FromFactory<>(Validate.notNull(sourceType, "sourceType"), Validate.notNull(targetType, "targetType"),
            mapping, matching);
    }
189097
private static function getFieldBuilderMapping(string $builderName, string $builderType, array $builderConfig, array &$reservedTypesMap)
    {
        $builder = self::getBuilder($builderName, $builderType);
        $mapping = $builder->toMappingDefinition($builderConfig);

        $fieldMappingKey = null;

        if (self::BUILDER_FIELD_TYPE === $builderType) {
            $fieldMappingKey = 'field';
        } elseif (self::BUILDER_FIELDS_TYPE === $builderType) {
            $fieldMappingKey = 'fields';
        }

        $fieldMapping = $mapping[$fieldMappingKey] ?? $mapping;
        $typesMapping = [];

        if (isset($mapping[$fieldMappingKey], $mapping['types'])) {
            $builderClass = \get_class($builder);

            foreach ($mapping['types'] as $typeName => $typeConfig) {
                if (isset($reservedTypesMap[$typeName])) {
                    throw new InvalidConfigurationException(\sprintf(
                        'Type "%s" emitted by builder "%s" already exists. Type was provided by "%s". Builder may only emit new types. Overriding is not allowed.',
                        $typeName,
                        $builderClass,
                        $reservedTypesMap[$typeName]
                    ));
                }

                $reservedTypesMap[$typeName] = $builderClass;
                $typesMapping[$typeName] = $typeConfig;
            }
        }

        return [
            $fieldMappingKey => $fieldMapping,
            'types' => $typesMapping,
        ];
    }
158471
public function getSourceChildPropertiesToBeConverted($source) {
		if (is_string($source)) {
			$source = [
				'payload' => [
					'__identity' => $source,
				]
			];
		} elseif (isset($source['__identity'])) {
			$source['payload'] = [
				'__identity' => $source['__identity'],
			];
			unset($source['__identity']);
		} elseif (!isset($source['payload'])) {
			$source['payload'] = [];
		}
		$source = parent::getSourceChildPropertiesToBeConverted($source);
		return $source;
	}
97667
public function convertFromTypeDefinition(TypeDefinitionInterface $typeDefinition)
    {
        $propertyList = [
            'baseTypeId' => JSONConstants::JSON_TYPE_BASE_ID,
            'parentTypeId' => JSONConstants::JSON_TYPE_PARENT_ID
        ];

        if ($typeDefinition instanceof RelationshipTypeDefinitionInterface) {
            $propertyList['allowedTargetTypeIds'] = JSONConstants::JSON_TYPE_ALLOWED_TARGET_TYPES;
            $propertyList['allowedSourceTypeIds'] = JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES;
        }

        $data = $typeDefinition->exportGettableProperties(
            $propertyList
        );
        $data = $this->castArrayValuesToSimpleTypes($data);

        return json_encode($data, JSON_FORCE_OBJECT);
    }