Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TYPO3 Developer Days 2025 - Schema API and Reco...

TYPO3 Developer Days 2025 - Schema API and Record API

TYPO3 v13 ships with two new concepts that lets you write less PHP arrays, and more objects - bringing TYPO3 to the next level.

Avatar for Benni Mack

Benni Mack

August 08, 2025
Tweet

More Decks by Benni Mack

Other Decks in Technology

Transcript

  1. SCHEMA API & RECORD API FROM 25 YEARS OF ARRAY

    ARCHAEOLOGY TO MODERN OOP PARADISE
  2. Benni Mack - TYPO3 Developer Days 2025 ABOUT THIS TALK

    TARGET AUDIENCE - TYPO3 developers tired of array nightmares - Anyone who's ever written isset($GLOBALS['TCA']...) more than once - People who want better sleep at night
  3. Benni Mack - TYPO3 Developer Days 2025 ABOUT THIS TALK

    WHAT WE'LL COVER - The Great TCA History (spoiler: it's been a wild ride!) - Schema API: Our modern superhero cape - Record API: From raw arrays to rich objects - Real-world examples that'll make you jump - The future: Prepare for more
  4. Benni Mack - TYPO3 Developer Days 2025 TCA REALITY CHECK:

    WHAT WE'VE BEEN LIVING WITH THE HORROR STORIES WE ALL KNOW Real DataHandler statistics in April 2024: - 184 direct $GLOBALS['TCA'] accesses (in ONE f ile!) - 15+ di ff erent ways to check if a table is localizable - Zero type safety (PHP8 is crying) - ∞ developer headaches from unde f ined index errors
  5. Benni Mack - TYPO3 Developer Days 2025 WHY ARRAYS STARTED

    FEELING ANCIENT ENTER PHP 8 & MODERN TIMES PHP Evolution Timeline - PHP 7.0: Scalar type declarations - PHP 7.4: Typed properties - PHP 8.0: Union types, named arguments - PHP 8.1: Readonly properties - Meanwhile, TCA... Still a giant array party
  6. Benni Mack - TYPO3 Developer Days 2025 OUR REAL PROBLEMS

    WITH TCA SCHEMA API - No-brainer: Array Syntax - What is required to make a TCA table localizable? Multiple variations in Core found - Conglomeration of helper methods in BackendUtility etc. ("isWorkspaceEnabled") - What happens if I forget "allowed" section in "type=group"? - Is "1" or "true" or true OK for $GLOBALS['TCA']['pages']['columns']['title']['exclude'] ?
  7. Benni Mack - TYPO3 Developer Days 2025 MISSING KNOW-HOW VIA

    TCA - DATA CONSISTENCY SCHEMA API - What f ields are pointing to this table? What relations are available from and to this table? - What is the parent table of this IRRE table even though the f ield is "type=passthrough"? - What's the real f lexform de f inition here? - Is "bodytext" a RTE or a plain textarea f ield? Subtype knowledge is complicated - What f ields are available in "tt_content.textpic" vs. "tt_content.text"?
  8. Benni Mack - TYPO3 Developer Days 2025 ARCHITECTURE SCHEMA API

    We might have other schemata in the future Schema pages pages shortcut pages external pages default TCA Schema Factory Capabilities ? language Aware ? can Be Disabled ? allowed on rootLevel Subschema Fields File Inline Number Schema be_users
  9. Benni Mack - TYPO3 Developer Days 2025 ARCHITECTURE SCHEMA API

    - Only meant for READING TCA, never creating or writing - Inject TcaSchemaFactory object - built from $GLOBALS['TCA'] - Get a schema, f ind subschemata, f ields or capabilities ("columnsOverrides") - Immutable - never changed during runtime - Fully cached (no Con f iguration/TCA Support) - Only works on static information on purpose — what is possible?
  10. Benni Mack - TYPO3 Developer Days 2025 CAPABILITIES SCHEMA API

    - Can this schema translate its records (isLocalizable) - 101 times in Core now - is there a hidden f ield? what's the name? What about start time / endtime f ields? - [ctrl][adminOnly] - [ctrl][label], [ctrl][label_alt], [ctrl][label_alt_force]...
  11. Benni Mack - TYPO3 Developer Days 2025 FIELDS SCHEMA API

    - All FieldTypes supported in Core - Select, Inline, File, Text, DateTime, Input, Flex, Checkbox - Select is split into various parts (Static List etc) - What kind of relationship is the FieldType in? 1:1, Multiple - Active Relations are connected to a f ield, Passive Relations are connected to a Schema
  12. Benni Mack - TYPO3 Developer Days 2025 TIMELINE SCHEMA API

    - Initially kickstarted in 2021, merged in July 2024 in v13 - Utilized by content blocks in v13 - Rolled out until July 2025 - no @internal anymore in v14 - FormEngine + LowLevel API is still missing - Improvements will continue once Schema API can be used for more than TCA
  13. Benni Mack - TYPO3 Developer Days 2025 NOT AN ARRAY,

    BUT NOT AN ORM RECORD API We want - a f lexible and extensible API that is not a fully modeled entity - to know more about the meaning of the value of the f ield - to enrich the values from the DB - to know if it exists in a certain "type" (e.g. tt_content.textpic) - it to be performant with relations
  14. Benni Mack - TYPO3 Developer Days 2025 BUILD AN OBJECT

    OUT OF THE ARRAY RECORD API RecordInterface RawRecord + Contains all f ields of the DB record + Knows its type ("I am tt_content") + Knows computed properties (language ID + version ID instead of "_versionedId" and "_LOCALIZED_UID") Record + Knows its subtype ("I am tt_content.textpic") + Contains system properties (createdAt, isDisabled) + Can contain closures to resolve the value of a property
  15. Benni Mack - TYPO3 Developer Days 2025 LAZY + GREEDY

    CONCEPTS The Challenge: Avoid N+1 query problems while maintaining performance The Solution: Smart bulk loading 1. Lazy: Create collections without immediate database queries 2. Greedy: When f irst accessed, load ALL related data for ALL records in batch 3. Cache / Map: Store results in RecordIdentityMap for subsequent access 4. Identity: Prevent duplicate objects
  16. Benni Mack - TYPO3 Developer Days 2025 NOT AN ARRAY,

    BUT NOT AN ORM RECORD API - Based on Schema API: Supports all types of TCA - DateTime, Relations (= more record objects), File objects, FlexForm - DataProcessors: Can be used in Fluid directly, and for the whole page - In v14: Available in the Page Module for Content Previews - Extend Record API with your own custom logic (e.g. Users, Containers etc)
  17. Benni Mack - TYPO3 Developer Days 2025 SCHEMA API AND

    RECORD API OVERALL GAINS - OOP instead of arrays - Uni f ication in code base - easier transformation - One API instead of 100 ways in PHP / TYPO3 - Basis for Content Blocks - Performance done right
  18. Benni Mack - TYPO3 Developer Days 2025 WHAT ABOUT EXTBASE?

    Record API Extbase Domain Models Purpose Data representation & display Business logic & validation Scope Any TCA-based record Extension-speci f ic entities Performance Lightweight transformation Full ORM stack Relations Lazy, f ixed Bidirectional, dynamic Validation None (read-only) Built-in property validation Persistence Read-only Full CRUD operations
  19. Benni Mack - TYPO3 Developer Days 2025 SCHEMA API AND

    RECORD API NEXT STEPS FOR TYPO3 - "Public" API in v14 (use in v13 at your own risk — or trust me 😉 ) - Schema API: 95% done - Record API: Switch all frontend calls and backend modules - TCA: Simplify logic - API will be kept stable - Record API > DataMapper in Extbase Data Handling? - Your Ideas and Experiments?