Answer the question
In order to leave comments, you need to log in
How to search across multiple Doctrine entities?
Greetings!
There was a need to implement a search among several entities present in the system. For example, there is a user with the fullName property (Ivan Pertov) and an article with the title property (Ivan on the road). That is, for the query "Ivan" I would like to get a result that includes users and articles with this entry.
Tell me which way to dig.
At the moment, I have two suggestions:
The first is to pull the relevant repositories and then merge the result.
The second is to create a separate entity that stores the fields by which the search is carried out, and a link to a specific object, and search already in it.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question