Attention
TYPO3 v12 has reached end-of-life as of April 30th 2026 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v12 here: TYPO3 ELTS.
Persistence in Extbase
Create an entity class and repository:
-
Add
example-extension/ Classes/ Domain/ Model/ {entity name}. php - Inside the file create a PHP class matching the filename and extend from
TYPO3CMSExtbaseDomain Object Abstract Entity - Add database columns as class properties, using type declarations matching your domain model properties
- Add getter and setter for each property
- Inside the file create a PHP class matching the filename and extend from
-
Add
example-extension/ Classes/ Domain/ Repository/ {entity name}Repository. php - Like with the model before, create a PHP class matching the naming schema and extend from
TYPO3CMSExtbasePersistence Repository
- Like with the model before, create a PHP class matching the naming schema and extend from
-
Add tests according to Testing
- Test getters and setters for entity class
- Test find methods of repository
- Test if test subject is an instance of the correct superclass