SchemaLabelResolver

readonly class \TYPO3\CMS\Core\Schema\SchemaLabelResolver

Resolves labels for TCA field items based on schema configuration and optional Page TSconfig overrides.

Returns raw (untranslated) labels — callers are responsible for running language translation (e.g. sL()) when needed.

Attributes

#[Autoconfigure]
$public: true

Table of Contents

Methods

__construct()  : mixed
getLabelForFieldValue()  : string
Resolve the label for a single field item value.
getLabelsForFieldValues()  : string[]
Resolve labels for a comma-separated list of field item values.

Methods

getLabelForFieldValue()

Resolve the label for a single field item value.

public getLabelForFieldValue(string $table, string $field, string $value[, array $row = [] ][, array $columnTsConfig = [] ][, array $fieldConfiguration = [] ]) : string

Parameters

$table : string

Table name

$field : string

Field name

$value : string

The item value to look up

$row : array = []

Record row, needed for itemsProcFunc/itemsProcessors context

$columnTsConfig : array = []

Optional TCEFORM.

. TSconfig array for addItems/altLabels overrides

$fieldConfiguration : array = []

Optional explicit field configuration (used for volatile configs like FlexForms)

Return values

string —

The raw (untranslated) label, or empty string if not found

getLabelsForFieldValues()

Resolve labels for a comma-separated list of field item values.

public getLabelsForFieldValues(string $table, string $field, string $valueList[, array $row = [] ][, array $columnTsConfig = [] ][, array $fieldConfiguration = [] ]) : string[]

Parameters

$table : string

Table name

$field : string

Field name

$valueList : string

Comma-separated list of item values

$row : array = []

Record row, needed for itemsProcFunc/itemsProcessors context

$columnTsConfig : array = []

Optional TCEFORM.

. TSconfig array for addItems/altLabels overrides

$fieldConfiguration : array = []

Optional explicit field configuration (used for volatile configs like FlexForms)

Return values

string[] —

Array of raw (untranslated) labels for each matched value

On this page