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
TYPO3\
CMS\ Extbase\ Domain 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
TYPO3\
CMS\ Extbase\ Persistence\ 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