AbstractTypeConverter
abstract class \
- Implements
- TypeConverterInterface, SingletonInterface
Type converter which provides sensible default implementations for most methods. If you extend this class you only need to implement convertFrom()
Table of Contents
Interfaces
- TypeConverterInterface
- Interface for type converters, which can convert from a simple type to an object or another simple type.
- SingletonInterface
- "empty" interface for singletons (marker interface pattern)
Methods
- getSourceChildPropertiesToBeConverted() : array
- Return a list of sub-properties inside the source object.
- getTargetTypeForSource() : string
- Returns the type for a given source, depending on e.g. the __type setting or other properties.
- getTypeOfChildProperty() : string
- Return the type of a given sub-property inside the $targetType
Methods
getSourceChildPropertiesToBeConverted()
Return a list of sub-properties inside the source object.
public
getSourceChildPropertiesToBeConverted(mixed $source) : array
Parameters
- $source : mixed
Tags
Return values
arraygetTargetTypeForSource()
Returns the type for a given source, depending on e.g. the __type setting or other properties.
public
getTargetTypeForSource(mixed $source, string $originalTargetType[, PropertyMappingConfigurationInterface|null $configuration = null ]) : string
Parameters
- $source : mixed
-
the source data
- $originalTargetType : string
-
the type we originally want to convert to
- $configuration : PropertyMappingConfigurationInterface|null = null
Tags
Return values
stringgetTypeOfChildProperty()
Return the type of a given sub-property inside the $targetType
public
getTypeOfChildProperty(string $targetType, string $propertyName, PropertyMappingConfigurationInterface $configuration) : string
Parameters
- $targetType : string
- $propertyName : string
- $configuration : PropertyMappingConfigurationInterface
Tags
Return values
string —the type of $propertyName in $targetType