---
title: "Domain layer in Extbase"
manual: "TYPO3 Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3coreapi:extbase-domain-subfolders@main"
source: "ExtensionArchitecture/Extbase/Domain/Index.rst"
rendered: "2026-09-20T15:52:37+00:00"
---

# Domain layer in Extbase {#extbase-domain-subfolders}

The domain layer is where your extension's data lives. It consists of two
things: **models**, which are PHP classes that represent your data, and
**repositories**, which are the only entry point for reading and writing that
data to the database.

A model describes what an object looks like — its properties, their types,
and how they relate to other objects. A repository knows how to find and
persist those objects. Controllers and views should never touch the database directly,
but refer such tasks to a repository.

Value objects — objects defined by their value rather than their identity —
are also part of the domain layer. In TYPO3 v14, value objects are implemented
as plain PHP classes rather than by extending an Extbase base class.
Their usage is covered in the [model page](https://docs.typo3.org/permalink/t3coreapi:extbase-domain-model-value-objects@main).

**[Model](https://docs.typo3.org/permalink/t3coreapi:extbase-domain-model@main)**

How to define domain objects that map to database records.
Covers `AbstractEntity`, property types, extbase related PHP attributes,
relations, enums and table mapping.

**[Repository](https://docs.typo3.org/permalink/t3coreapi:extbase-domain-repository@main)**

How to find and persist domain objects. Covers built-in find
methods, default ordering and custom queries.
StoragePid configuration gets special attention.

**[File uploads](https://docs.typo3.org/permalink/t3coreapi:extbase-domain-fileupload@main)**

Reading FAL file references from a
domain model, handling uploads with `#[FileUpload]`, validation and
deletion.

**[Data transfer objects](https://docs.typo3.org/permalink/t3coreapi:extbase-domain-dto@main)**

Non-persisted objects that carry data between the business logic and the
view: validation, converting to a model, session storage and demand
objects.

**[Property types](https://docs.typo3.org/permalink/t3coreapi:extbase-domain-property-types@main)**

Which PHP property types map to which TCA field and database column:
primitives, `\DateTime`,
`Country`, enumerations and
union types.
