php - Get fetched result in different arrays by joined tables

one text

Solution:

As discussed here, the workflow that interests me is more "use case" based, and then it doesn't make sense to do what I requested (as it would kind of be reinventing ORM which I did first).

What works out for me is creating specific DTOs with high cohesion like UserPost in which case the origin of the table is not relevant as fields are selected individually, precisely.

Source