![]() |
TYPO3
7.6
|
Public Member Functions | |
injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) | |
injectConfigurationBuilder (\TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationBuilder $configurationBuilder) | |
initializeObject () | |
convert ($source, $targetType, PropertyMappingConfigurationInterface $configuration=null) | |
getMessages () | |
parseCompositeType ($compositeType) | |
Protected Member Functions | |
doMapping ($source, $targetType, PropertyMappingConfigurationInterface $configuration, &$currentPropertyPath) | |
findTypeConverter ($source, $targetType, PropertyMappingConfigurationInterface $configuration) | |
findFirstEligibleTypeConverterInObjectHierarchy ($source, $sourceType, $targetClass) | |
getConvertersForInterfaces (array $convertersForSource, array $interfaceNames) | |
determineSourceType ($source) | |
Protected Attributes | |
$objectManager | |
$configurationBuilder | |
$typeConverters = array() | |
$messages | |
The Property Mapper transforms simple types (arrays, strings, integers, floats, booleans) to objects or other simple types. It is used most prominently to map incoming HTTP arguments to objects.
http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
Definition at line 34 of file PropertyMapper.php.
convert | ( | $source, | |
$targetType, | |||
PropertyMappingConfigurationInterface | $configuration = null |
||
) |
Map $source to $targetType, and return the result
mixed | $source | the source data to map. MUST be a simple type, NO object allowed! |
string | $targetType | The type of the target; can be either a class name or a simple type. |
PropertyMappingConfigurationInterface | $configuration | Configuration for the property mapping. If NULL, the PropertyMappingConfigurationBuilder will create a default configuration. |
Exception |
Definition at line 111 of file PropertyMapper.php.
References PropertyMapper\doMapping().
|
protected |
Determine the type of the source data, or throw an exception if source was an unsupported format.
mixed | $source |
Exception\InvalidSourceException |
Definition at line 356 of file PropertyMapper.php.
References elseif.
|
protected |
Internal function which actually does the property mapping.
mixed | $source | the source data to map. MUST be a simple type, NO object allowed! |
string | $targetType | The type of the target; can be either a class name or a simple type. |
PropertyMappingConfigurationInterface | $configuration | Configuration for the property mapping. |
array | &$currentPropertyPath | The property path currently being mapped; used for knowing the context in case an exception is thrown. |
Exception\TypeConverterException | |
Exception\InvalidPropertyMappingConfigurationException |
Definition at line 154 of file PropertyMapper.php.
References PropertyMapper\findTypeConverter(), PropertyMappingConfigurationInterface\getTargetPropertyName(), PropertyMapper\parseCompositeType(), PropertyMappingConfigurationInterface\shouldSkip(), and PropertyMappingConfigurationInterface\shouldSkipUnknownProperties().
Referenced by PropertyMapper\convert().
|
protected |
Tries to find a suitable type converter for the given source and target type.
string | $source | The actual source value |
string | $sourceType | Type of the source to convert from |
string | $targetClass | Name of the target class to find a type converter for |
Exception\InvalidTargetException |
Definition at line 263 of file PropertyMapper.php.
|
protected |
Determine the type converter to be used. If no converter has been found, an exception is raised.
mixed | $source | |
string | $targetType | |
PropertyMappingConfigurationInterface | $configuration |
Exception\TypeConverterException | |
Exception\InvalidTargetException |
Definition at line 218 of file PropertyMapper.php.
Referenced by PropertyMapper\doMapping().
|
protected |
array | $convertersForSource | |
array | $interfaceNames |
Exception\DuplicateTypeConverterException |
Definition at line 333 of file PropertyMapper.php.
getMessages | ( | ) |
Get the messages of the last Property Mapping
Definition at line 138 of file PropertyMapper.php.
References PropertyMapper\$messages.
initializeObject | ( | ) |
Lifecycle method, called after all dependencies have been injected. Here, the typeConverter array gets initialized.
Exception\DuplicateTypeConverterException |
Definition at line 88 of file PropertyMapper.php.
References $GLOBALS.
injectConfigurationBuilder | ( | \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationBuilder | $configurationBuilder | ) |
\TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationBuilder | $configurationBuilder |
Definition at line 76 of file PropertyMapper.php.
References PropertyMapper\$configurationBuilder.
injectObjectManager | ( | \TYPO3\CMS\Extbase\Object\ObjectManagerInterface | $objectManager | ) |
\TYPO3\CMS\Extbase\Object\ObjectManagerInterface | $objectManager |
Definition at line 68 of file PropertyMapper.php.
References PropertyMapper\$objectManager.
parseCompositeType | ( | $compositeType | ) |
Parse a composite type like <> into
string | $compositeType |
Definition at line 380 of file PropertyMapper.php.
Referenced by PropertyMapper\doMapping().
|
protected |
Definition at line 44 of file PropertyMapper.php.
Referenced by PropertyMapper\injectConfigurationBuilder().
|
protected |
Definition at line 63 of file PropertyMapper.php.
Referenced by PropertyMapper\getMessages().
|
protected |
Definition at line 39 of file PropertyMapper.php.
Referenced by PropertyMapper\injectObjectManager().
|
protected |
Definition at line 56 of file PropertyMapper.php.