DefaultValuesResolver

final readonly class \TYPO3\CMS\Core\DataHandling\DefaultValuesResolver

Resolves the default values of a new record from "TCAdefaults" of PageTSconfig and UserTSconfig and from the TCA "default" configuration.

For each field, the value of the first source defining one is used:

  • PageTSconfig TCAdefaults of the record type
  • PageTSconfig TCAdefaults
  • UserTSconfig TCAdefaults of the record type
  • UserTSconfig TCAdefaults
  • TCA default of the record type (columnsOverrides)
  • TCA default

The record type is taken from the incoming field array, falling back to the TCAdefaults of the type field in PageTSconfig and UserTSconfig, and finally to the TCA default of the type field. A record type defined by a field of a related record is not resolved.

Table of Contents

Methods

__construct()  : mixed
resolve()  : array<string, mixed>

Methods

resolve()

public resolve(string $table, array $incomingFieldArray, array $pageTsConfigTcaDefaults, array $userTsConfigTcaDefaults) : array<string, mixed>

Parameters

$table : string
$incomingFieldArray : array

Field values given for the new record

$pageTsConfigTcaDefaults : array

The "TCAdefaults." PageTSconfig of the page the record is created on

$userTsConfigTcaDefaults : array

The "TCAdefaults." UserTSconfig of the current backend user

Return values

array<string, mixed> —

Default values by field name

On this page