RecordFieldTransformer
This generic mapper takes a field value of a record, and maps the value of a field with a specific type (TCA column type) to an expanded property (e.g. a type "file" field to a collection of FileReference objects).
Common examples are \DateTimeImmutable objects for TCA fields of type=datetime.
In general, this class is very inflexible, and not configurable, but we hope to extend this further in the future to add custom mappings.
This class also calls the RelationResolver for any kind of resolved relations, but tries to handle most of the logic on its own when no lazy-loading is needed.
About lazy-laading: For all relation types, which do not have a "toOne" relationship, a lazy collection is used. The relations in this collection are only resolved once they are accessed. For the "toOne" relations, a RecordPropertyClosure is used, which also initializes the corresponding record only when accessed. While a collection could be empty after being resolved, a single record might resolve to NULL, in case of an invalid relation value.
This class is not part of the TYPO3 Core API. It might get moved or changed.
Table of Contents
Properties
- $connectionPool : ConnectionPool
- $flexFormSchemaFactory : FlexFormSchemaFactory
- $flexFormService : FlexFormService
- $linkService : LinkService
- $relationResolver : RelationResolver
- $resourceFactory : ResourceFactory
- $typoLinkCodecService : TypoLinkCodecService
Methods
- __construct() : mixed
- transformField() : mixed
- processFlexForm() : FlexFormFieldValues
- This method creates an array which contains all information which is valid from the selected Schema. Ideally, this should be "FlexRecord" objects, and also keep the original values.
- resolveFoldersRecursive() : array<string|int, Folder>
Properties
$connectionPool
protected
ConnectionPool
$connectionPool
$flexFormSchemaFactory
protected
FlexFormSchemaFactory
$flexFormSchemaFactory
$flexFormService
protected
FlexFormService
$flexFormService
$linkService
protected
LinkService
$linkService
$relationResolver
protected
RelationResolver
$relationResolver
$resourceFactory
protected
ResourceFactory
$resourceFactory
$typoLinkCodecService
protected
TypoLinkCodecService
$typoLinkCodecService
Methods
__construct()
public
__construct(RelationResolver $relationResolver, ResourceFactory $resourceFactory, FlexFormService $flexFormService, FlexFormSchemaFactory $flexFormSchemaFactory, LinkService $linkService, TypoLinkCodecService $typoLinkCodecService, ConnectionPool $connectionPool) : mixed
Parameters
- $relationResolver : RelationResolver
- $resourceFactory : ResourceFactory
- $flexFormService : FlexFormService
- $flexFormSchemaFactory : FlexFormSchemaFactory
- $linkService : LinkService
- $typoLinkCodecService : TypoLinkCodecService
- $connectionPool : ConnectionPool
transformField()
public
transformField(FieldTypeInterface $fieldInformation, RawRecord $rawRecord, Context $context, RecordIdentityMap $recordIdentityMap) : mixed
Parameters
- $fieldInformation : FieldTypeInterface
- $rawRecord : RawRecord
- $context : Context
- $recordIdentityMap : RecordIdentityMap
processFlexForm()
This method creates an array which contains all information which is valid from the selected Schema. Ideally, this should be "FlexRecord" objects, and also keep the original values.
protected
processFlexForm(RawRecord $record, FlexFormFieldType $fieldInformation, mixed $fieldValue, Context $context, RecordIdentityMap $recordIdentityMap) : FlexFormFieldValues
This functionality will likely change in the future.
Parameters
- $record : RawRecord
- $fieldInformation : FlexFormFieldType
- $fieldValue : mixed
- $context : Context
- $recordIdentityMap : RecordIdentityMap
Return values
FlexFormFieldValuesresolveFoldersRecursive()
protected
resolveFoldersRecursive(array<string|int, mixed> $folders) : array<string|int, Folder>
Parameters
- $folders : array<string|int, mixed>