ArrayFromObjectConverter
class ArrayFromObjectConverter extends AbstractTypeConverter (View source)
TypeConverter which converts generic objects to arrays by converting and returning
Properties
protected string[] | $sourceTypes | ||
protected string | $targetType | ||
protected int | $priority | ||
protected PersistenceManagerInterface | $persistenceManager |
Methods
Returns the list of source types the TypeConverter can handle.
Return the target type this TypeConverter converts to.
Returns the $originalTargetType unchanged in this implementation.
Return the priority of this TypeConverter. TypeConverters with a high priority are chosen before low priority.
This implementation always returns true for this method.
Convert all properties in the source array
No description
Actually convert from $source to $targetType, taking into account the fully built $convertedChildProperties and $configuration.
Details
string[]
getSupportedSourceTypes()
Returns the list of source types the TypeConverter can handle.
Must be PHP simple types, classes or object is not allowed.
string
getSupportedTargetType()
Return the target type this TypeConverter converts to.
Can be a simple type or a class name.
string
getTargetTypeForSource(mixed $source, string $originalTargetType, PropertyMappingConfigurationInterface $configuration = null)
Returns the $originalTargetType unchanged in this implementation.
int
getPriority()
Return the priority of this TypeConverter. TypeConverters with a high priority are chosen before low priority.
bool
canConvertFrom(mixed $source, string $targetType)
This implementation always returns true for this method.
array
getSourceChildPropertiesToBeConverted(mixed $source)
Convert all properties in the source array
string
getTypeOfChildProperty(string $targetType, string $propertyName, PropertyMappingConfigurationInterface $configuration)
No description
mixed|null|Error
convertFrom(mixed $source, string $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)
Actually convert from $source to $targetType, taking into account the fully built $convertedChildProperties and $configuration.
The return value can be one of three types:
- an arbitrary object, or a simple type (which has been created while mapping). This is the normal case.
- NULL, indicating that this object should not be mapped (i.e. a "File Upload" Converter could return NULL if no file has been uploaded, and a silent failure should occur.
- An instance of \Neos\Error\Messages\Error -- This will be a user-visible error message later on. Furthermore, it should throw an Exception if an unexpected failure (like a security error) occurred or a configuration issue happened.