‪TYPO3CMS  9.5
TYPO3\CMS\Extbase\Property\TypeConverter\ObjectStorageConverter Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Property\TypeConverter\ObjectStorageConverter:
TYPO3\CMS\Extbase\Property\TypeConverter\AbstractTypeConverter TYPO3\CMS\Extbase\Property\TypeConverterInterface TYPO3\CMS\Core\SingletonInterface

Public Member Functions

TYPO3 CMS Extbase Persistence ObjectStorage convertFrom ($source, $targetType, array $convertedChildProperties=[], \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration=null)
 
array getSourceChildPropertiesToBeConverted ($source)
 
string getTypeOfChildProperty ($targetType, $propertyName, \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Extbase\Property\TypeConverter\AbstractTypeConverter
 injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
array< string > getSupportedSourceTypes ()
 
string getSupportedTargetType ()
 
string getTargetTypeForSource ($source, $originalTargetType, \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration=null)
 
int getPriority ()
 
bool canConvertFrom ($source, $targetType)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Extbase\Property\TypeConverterInterface
string getTargetTypeForSource ($source, $originalTargetType, PropertyMappingConfigurationInterface $configuration=null)
 

Protected Attributes

array< string > $sourceTypes = array( 'string', 'array' )
 
string $targetType = \TYPO3\CMS\Extbase\Persistence\ObjectStorage::class
 
int $priority = 10
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Extbase\Property\TypeConverter\AbstractTypeConverter
array< string > $sourceTypes = array( )
 
string $targetType = ''
 
int $priority
 
TYPO3 CMS Extbase Object ObjectManagerInterface $objectManager
 

Detailed Description

Converter which transforms simple types to an ObjectStorage.

Todo:
‪Implement functionality for converting collection properties.

Definition at line 22 of file ObjectStorageConverter.php.

Member Function Documentation

◆ convertFrom()

TYPO3 CMS Extbase Persistence ObjectStorage TYPO3\CMS\Extbase\Property\TypeConverter\ObjectStorageConverter::convertFrom (   $source,
  $targetType,
array  $convertedChildProperties = [],
\TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface  $configuration = null 
)

Actually convert from $source to $targetType, taking into account the fully built $convertedChildProperties and $configuration.

Parameters
mixed$source
string$targetType
array$convertedChildProperties
\TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface$configuration
Returns
‪\TYPO3\CMS\Extbase\Persistence\ObjectStorage

Implements TYPO3\CMS\Extbase\Property\TypeConverterInterface.

Definition at line 46 of file ObjectStorageConverter.php.

◆ getSourceChildPropertiesToBeConverted()

array TYPO3\CMS\Extbase\Property\TypeConverter\ObjectStorageConverter::getSourceChildPropertiesToBeConverted (   $source)

Returns the source, if it is an array, otherwise an empty array.

Parameters
mixed$source
Returns
‪array

Reimplemented from TYPO3\CMS\Extbase\Property\TypeConverter\AbstractTypeConverter.

Definition at line 61 of file ObjectStorageConverter.php.

◆ getTypeOfChildProperty()

string TYPO3\CMS\Extbase\Property\TypeConverter\ObjectStorageConverter::getTypeOfChildProperty (   $targetType,
  $propertyName,
\TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface  $configuration 
)

Return the type of a given sub-property inside the $targetType

Parameters
string$targetType
string$propertyName
\TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface$configuration
Returns
‪string

Reimplemented from TYPO3\CMS\Extbase\Property\TypeConverter\AbstractTypeConverter.

Definition at line 77 of file ObjectStorageConverter.php.

References TYPO3\CMS\Extbase\Property\TypeConverter\ObjectStorageConverter\$targetType, and TYPO3\CMS\Extbase\Utility\TypeHandlingUtility\parseType().

Member Data Documentation

◆ $priority

int TYPO3\CMS\Extbase\Property\TypeConverter\ObjectStorageConverter::$priority = 10
protected

Definition at line 34 of file ObjectStorageConverter.php.

◆ $sourceTypes

array<string> TYPO3\CMS\Extbase\Property\TypeConverter\ObjectStorageConverter::$sourceTypes = array( 'string', 'array' )
protected

Definition at line 26 of file ObjectStorageConverter.php.

◆ $targetType

string TYPO3\CMS\Extbase\Property\TypeConverter\ObjectStorageConverter::$targetType = \TYPO3\CMS\Extbase\Persistence\ObjectStorage::class
protected