Normalizers and transformers
This page lists the built-in conversion services, their interfaces and their DI tags — the lookup companion to Architecture.
Normalizer chain
Normalizers implement Normalizer and are registered with the DI tag nb_. The chain consults them in order (tag priority, highest first); the first supports wins. If none matches, the Unknown emits null and logs the type.
interface NormalizerInterface
{
public function supports(mixed $value, Context $context): bool;
public function normalize(mixed $value, Context $context): mixed;
}
Built-in normalizers (Classes/):
| Normalizer | Claims | Output |
|---|---|---|
Scalar | null, int, string, plain arrays | passthrough (arrays recurse via the chain) |
Date | Date | formatted string, options. (default W3C) |
Flex | Flex | parsed array |
Typolink | Typolink | link object; null when empty; __ shape when unresolvable |
Record | Record | full record conversion via Context:: |
Record | Lazy | array; sys_ → reduced uid/, everything else per-record recursion |
File | File, Lazy | file object incl. crop-aware public and declarative thumbnails |
Folder | Lazy | array of storage-absolute paths |
Unknown | everything (fallback, not tagged) | null + debug log |
Field value transformer chain
Transformers implement Field and are registered with the DI tag nb_. They shape string values based on the field's Schema API type before the value reaches the JSON. First supports wins.
interface FieldValueTransformerInterface
{
public function supports(FieldTypeInterface $field): bool;
public function transform(string $value, FieldTypeInterface $field, Context $context): string;
}
Built-in transformers (Classes/):
| Transformer | Applies to | Output |
|---|---|---|
Password | Password fields | "" |
Richtext | Text fields with richtext enabled | HTML via parse |
Context
Normalization/ carries the per-run state:
| Member | Purpose |
|---|---|
get | current table schema (sub-schema per record type) |
get | PSR-7 request of the originating DataProcessor (may be null in CLI/unit contexts) |
get | the processor's Content (may be null in CLI/unit contexts) |
get / get | TypoScript options. of the processor |
get | image variant definitions of the field being normalized |
get | the normalizer chain — for recursion without circular DI |
build | full record conversion — for nested records |
get | PSR-14 dispatcher (deprecated event) |
Registering your own
See the how-to guides: register a custom normalizer and register a field value transformer.