Data Transfer Object (DTO)
DTO stands for Data Transfer Object. It is an object that carries data between methods and different part of the architecture.
DTO is a class, with only properties. It replaces advantageously arrays. It may be used for typing, and do not hold methods.
DTO are easily confused with Value Object: the first one’s role is to carry data inside the application, the second one holds data, and can only be compared by its values.
See Also
- Data Transfer Object V3 Modernizes DTOs With PHP 8 Features
- Is it a DTO or a Value Object?
- How I built Tjommi