Reputation: 2729
Is it possible to return results from multiple entities?
Eg: Entity1, Entity2, Entity3, Entity4
Each Entity will have a column title
. There will be a where statement on the title field to return the filtered record.
The entities do not have a relationship with each other.
I was thinking of putting it in the Entity1Repository but the filter will only filter records from Entity1
The only solution I can think of is to get the results for each entity and combine all the results.
Upvotes: 1
Views: 989
Reputation: 71
You can return results as array
->getResult(\Doctrine\ORM\Query::HYDRATE_ARRAY);
and merge it. array_merge() Or entity repository.
Upvotes: 0