Answer the question
In order to leave comments, you need to log in
How to take data from two tables in Symfony4?
How to take data from 2 or more tables, all tables are linked by id. But how to take data if there is a connection and when it is not?
Answer the question
In order to leave comments, you need to log in
1) Using doctrine links at the entity level is not the best practice if we are talking about high-load, because it does not work in the best way. For projects where entries in tables are less than 100k, in general, you can.
2) If you need a query in the language of the doctrine to two tables, then:
In the repository of one table, write a query, where we insert the line
...
->from(Client::class, 'cl')
->where('cl.siteId = c.siteId')
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question