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

Public Member Functions

bool canConvertFrom ($source, $targetType)
 
array convertFrom ($source, $targetType, array $convertedChildProperties=[], \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration=null)
 
- ‪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 ()
 
array getSourceChildPropertiesToBeConverted ($source)
 
 getTypeOfChildProperty ($targetType, $propertyName, \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Extbase\Property\TypeConverterInterface
string getTargetTypeForSource ($source, $originalTargetType, PropertyMappingConfigurationInterface $configuration=null)
 

Protected Attributes

array< string > $sourceTypes = array( 'array', 'string' )
 
string $targetType = 'array'
 
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 arrays to arrays.

Definition at line 20 of file ArrayConverter.php.

Member Function Documentation

◆ canConvertFrom()

bool TYPO3\CMS\Extbase\Property\TypeConverter\ArrayConverter::canConvertFrom (   $source,
  $targetType 
)

We can only convert empty strings to array or array to array.

Parameters
mixed$source
string$targetType
Returns
‪bool

only to be used within Extbase, not part of TYPO3 Core API.

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

Definition at line 42 of file ArrayConverter.php.

◆ convertFrom()

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

Convert from $source to $targetType, a noop if the source is an array. If it is an empty string it will be converted to an empty array.

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

Implements TYPO3\CMS\Extbase\Property\TypeConverterInterface.

Definition at line 57 of file ArrayConverter.php.

Member Data Documentation

◆ $priority

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

Definition at line 32 of file ArrayConverter.php.

◆ $sourceTypes

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

Definition at line 24 of file ArrayConverter.php.

◆ $targetType

string TYPO3\CMS\Extbase\Property\TypeConverter\ArrayConverter::$targetType = 'array'
protected

Definition at line 28 of file ArrayConverter.php.