I am very new to Symfony, I was looking at the documentation regarding the models, and all the examples and indications place a lot of emphasis on entities ( Entities
) that are well defined in the DB. My problem is that the system I am doing requires many queries of the type
SELECT [MUCHOS CAMPOS, FUNCIONES CONCAT, CONDICIONES CASE, ETC] FROM TABLA_1
INNER JOIN TABLA_2 ...
INNER JOIN UNA_VISTA ...
So I'm half disoriented about which entity would have to declare (for the moment I'm handling the queries from the controller, but the idea is to respect the MVC model).
Do I make a table 1 entity and do all the queries in its class by doing INNER JOIN with the other tables without the latter having entities or do I have to create them for all? Do I need a repository, 3 (one for each entity) or none and I make the queries from one of the entities directly?
Clarification: the TABLA_2
and UNA_VISTA
do not have queries of themselves in isolation, that is, I do not have any query in the type code
SELECT [CAMPOS DE LA TABLA_2] FROM TABLA_2
So I do not know how much it is worth declaring entities for both.
If you could give me a hand, even if it is a small guide, I would greatly appreciate it. Greetings!