RecordFieldTransformer

Read onlyYes

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.

Internal

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

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

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
FlexFormFieldValues

resolveFoldersRecursive()

protected resolveFoldersRecursive(array<string|int, mixed> $folders) : array<string|int, Folder>
Parameters
$folders : array<string|int, mixed>
Return values
array<string|int, Folder>

        
On this page

Search results