RecordFactory

Read onlyYes

Creates record objects out of TCA-based database rows by evaluating the TCA columns and splitting everything which is not a declared column for a TCA type. This is usually the case when a TCA table has a 'typeField' defined, such as "pages", "be_users" and "tt_content".

In addition, the RecordFactory can create "Resolved records" by utilizing the RecordFieldTransformer. A "Resolved record" is checked for the actual type (TCA field column type) and is then resolved to

  • a relation (records, files or folders - wrapped in collections)
  • an exploded list (e.g. static select)
  • a FlexForm field
  • a DateTime field.

This means that the field value of a "Resolved Record" is expanded to the actual types (Date objects etc.)

Internal

not part of TYPO3 Core API yet.

Attributes
#[Autoconfigure]
$public: true

Table of Contents

Properties

$eventDispatcher  : EventDispatcherInterface
$fieldTransformer  : RecordFieldTransformer
$schemaFactory  : TcaSchemaFactory

Methods

__construct()  : mixed
createFromDatabaseRow()  : RecordInterface
Takes a full database record (the whole row), and creates a Record object out of it, based on the type of the record.
createRawRecord()  : RawRecord
Creates a raw record object from a table and a record array.
createResolvedRecordFromDatabaseRow()  : RecordInterface
Create a "resolved" record. Resolved means that the fields will have their values resolved and extended. A typical use-case is resolving of related records, or using \DateTimeImmutable objects for datetime fields.
createRecord()  : RecordInterface
Quick helper function in order to avoid duplicate code.
extractComputedProperties()  : ComputedProperties
extractSystemInformation()  : array<string|int, mixed>

Properties

$eventDispatcher

protected EventDispatcherInterface $eventDispatcher

Methods

createFromDatabaseRow()

Takes a full database record (the whole row), and creates a Record object out of it, based on the type of the record.

public createFromDatabaseRow(string $table, array<string|int, mixed> $record) : RecordInterface

This method does not handle special expansion of fields.

Parameters
$table : string
$record : array<string|int, mixed>
Tags
todo

Now unused - we might want to remove this again

Return values
RecordInterface

createRawRecord()

Creates a raw record object from a table and a record array.

public createRawRecord(string $table, array<string|int, mixed> $record) : RawRecord
Parameters
$table : string
$record : array<string|int, mixed>
Return values
RawRecord

createResolvedRecordFromDatabaseRow()

Create a "resolved" record. Resolved means that the fields will have their values resolved and extended. A typical use-case is resolving of related records, or using \DateTimeImmutable objects for datetime fields.

public createResolvedRecordFromDatabaseRow(string $table, array<string|int, mixed> $record[, Context|null $context = null ][, RecordIdentityMap|null $recordIdentityMap = null ]) : RecordInterface
Parameters
$table : string
$record : array<string|int, mixed>
$context : Context|null = null
$recordIdentityMap : RecordIdentityMap|null = null
Return values
RecordInterface

extractSystemInformation()

protected extractSystemInformation(TcaSchema $schema, RawRecord $rawRecord, array<string|int, mixed> $properties) : array<string|int, mixed>
Parameters
$schema : TcaSchema
$rawRecord : RawRecord
$properties : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results