TYPO3
7.6
|
Public Member Functions | |
getSupportedSourceTypes () | |
getSupportedTargetType () | |
getTargetTypeForSource ($source, $originalTargetType, PropertyMappingConfigurationInterface $configuration=null) | |
getPriority () | |
canConvertFrom ($source, $targetType) | |
getSourceChildPropertiesToBeConverted ($source) | |
getTypeOfChildProperty ($targetType, $propertyName,\TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration) | |
convertFrom ($source, $targetType, array $convertedChildProperties=array(),\TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration=null) | |
Interface for type converters, which can convert from a simple type to an object or another simple type.
All Type Converters should have NO INTERNAL STATE, such that they can be used as singletons and multiple times in succession (as this improves performance dramatically).
Definition at line 30 of file TypeConverterInterface.php.
canConvertFrom | ( | $source, | |
$targetType | |||
) |
Here, the TypeConverter can do some additional runtime checks to see whether it can handle the given source data and the given target type.
mixed | $source | the source data |
string | $targetType | the type to convert to. |
Implemented in AbstractTypeConverter, DateTimeConverter, ObjectConverter, PersistentObjectConverter, CoreTypeConverter, ArrayConverter, and ArrayToValidationElementConverter.
convertFrom | ( | $source, | |
$targetType, | |||
array | $convertedChildProperties = array() , |
||
\TYPO3\CMS\Extbase\Property\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:
mixed | $source | |
string | $targetType | |
array | $convertedChildProperties | |
\TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface | $configuration |
\TYPO3\CMS\Extbase\Property\Exception\TypeConverterException | thrown in case a developer error occurred |
Implemented in ObjectConverter, PersistentObjectConverter, DateTimeConverter, ArrayConverter, CoreTypeConverter, ObjectStorageConverter, FloatConverter, StringConverter, BooleanConverter, and IntegerConverter.
getPriority | ( | ) |
Return the priority of this TypeConverter. TypeConverters with a high priority are chosen before low priority.
Implemented in AbstractTypeConverter.
getSourceChildPropertiesToBeConverted | ( | $source | ) |
Return a list of sub-properties inside the source object. The "key" is the sub-property name, and the "value" is the value of the sub-property.
mixed | $source |
Implemented in AbstractTypeConverter, ObjectConverter, PersistentObjectConverter, and ObjectStorageConverter.
getSupportedSourceTypes | ( | ) |
Returns the list of source types the TypeConverter can handle. Must be PHP simple types, classes or object is not allowed.
Implemented in AbstractTypeConverter.
getSupportedTargetType | ( | ) |
Return the target type this TypeConverter converts to. Can be a simple type or a class name.
Implemented in AbstractTypeConverter.
getTargetTypeForSource | ( | $source, | |
$originalTargetType, | |||
PropertyMappingConfigurationInterface | $configuration = null |
||
) |
Returns the type for a given source, depending on e.g. the __type setting or other properties.
mixed | $source | the source data |
string | $originalTargetType | the type we originally want to convert to |
\TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface | $configuration |
getTypeOfChildProperty | ( | $targetType, | |
$propertyName, | |||
\TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface | $configuration | ||
) |
Return the type of a given sub-property inside the $targetType
string | $targetType | |
string | $propertyName | |
\TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface | $configuration |
Implemented in AbstractTypeConverter, ObjectConverter, PersistentObjectConverter, and ObjectStorageConverter.