class EntityToIdentityConverter extends AbstractTypeConverter (View source)

Converts the given entity to a JSON representation containing the identity and object type

Properties

protected string[] $sourceTypes

The source types this converter can convert.

protected string $targetType

The target type this converter can convert to.

protected int $priority

The priority for this converter.

protected PersistenceManagerInterface $persistenceManager

Methods

bool
canConvertFrom(object $source, string $targetType)

Check if the given object has an identity.

array
convertFrom(object $source, string $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)

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

Details

bool canConvertFrom(object $source, string $targetType)

Check if the given object has an identity.

Parameters

object $source

the source data

string $targetType

the type to convert to.

Return Value

bool

true if this TypeConverter can convert from $source to $targetType, false otherwise.

array convertFrom(object $source, string $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)

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

Parameters

object $source
string $targetType
array $convertedChildProperties
PropertyMappingConfigurationInterface $configuration

Return Value

array