‪TYPO3CMS  ‪main
TYPO3\CMS\Extbase\Property\TypeConverterRegistry Class Reference

Public Member Functions

 add (TypeConverterInterface $converter, int $priority, array $sources, string $target)
 
 findTypeConverter (string $sourceType, string $targetType)
 

Protected Member Functions

 findFirstEligibleTypeConverterInObjectHierarchy (string $sourceType, string $targetClass)
 
 findEligibleConverterWithHighestPriority (array $converters)
 
TypeConverterInterface[] getConvertersForInterfaces (array $convertersForSource, array $interfaceNames)
 

Protected Attributes

array $typeConverters = []
 

Detailed Description

Registry containing all available Type Converters, registered via Services.yaml.

not part of TYPO3 Core API, as this is a framework-internal registry.

Definition at line 27 of file TypeConverterRegistry.php.

Member Function Documentation

◆ add()

TYPO3\CMS\Extbase\Property\TypeConverterRegistry::add ( TypeConverterInterface  $converter,
int  $priority,
array  $sources,
string  $target 
)

Used in the TypeConverterPass only.

Parameters
array | string[]$sources
Exceptions
Exception

Definition at line 41 of file TypeConverterRegistry.php.

◆ findEligibleConverterWithHighestPriority()

TYPO3\CMS\Extbase\Property\TypeConverterRegistry::findEligibleConverterWithHighestPriority ( array  $converters)
protected

◆ findFirstEligibleTypeConverterInObjectHierarchy()

TYPO3\CMS\Extbase\Property\TypeConverterRegistry::findFirstEligibleTypeConverterInObjectHierarchy ( string  $sourceType,
string  $targetClass 
)
protected

Tries to find a suitable type converter for the given source type and target type.

Parameters
string$sourceType‪Type of the source to convert from
class-string$targetClass‪Name of the target class to find a type converter for
Exceptions
Exception

Definition at line 98 of file TypeConverterRegistry.php.

References TYPO3\CMS\Extbase\Property\TypeConverterRegistry\findEligibleConverterWithHighestPriority(), and TYPO3\CMS\Extbase\Property\TypeConverterRegistry\getConvertersForInterfaces().

Referenced by TYPO3\CMS\Extbase\Property\TypeConverterRegistry\findTypeConverter().

◆ findTypeConverter()

◆ getConvertersForInterfaces()

TypeConverterInterface [] TYPO3\CMS\Extbase\Property\TypeConverterRegistry::getConvertersForInterfaces ( array  $convertersForSource,
array  $interfaceNames 
)
protected
Parameters
array<string,array<int,TypeConverterInterface>>‪$convertersForSource
class-string[]$interfaceNames
Returns
TypeConverterInterface[]
Exceptions
Exception

Definition at line 166 of file TypeConverterRegistry.php.

Referenced by TYPO3\CMS\Extbase\Property\TypeConverterRegistry\findFirstEligibleTypeConverterInObjectHierarchy().

Member Data Documentation

◆ $typeConverters

array TYPO3\CMS\Extbase\Property\TypeConverterRegistry::$typeConverters = []
protected

Definition at line 32 of file TypeConverterRegistry.php.