In a Symfony 3.4 Application I have an Entity with 4 properties plus the id.
It is managed by doctrine on a mySql DB.
Say the properties where named p1, p2, p3 and q. An example DB table could be like this:
id p1 p2 p3 q
------------------
1 x y z 1
2 x y n 2
3 x z 1
4 x z 2
5 x y z 3
6 x y z 4
7 x n z 1
What I need to do is to request all entities from the DB that have different combinations of p1, p2, p3. So using the given sample DB table the result I need would be
id p1 p2 p3 q
------------------
1 x y z 1
2 x y n 2
3 x z 1
7 x n z 1
So the rows with id's 4, 5 and 6 wouldn't be in the set because the have "doubled" combinations of p1, p2, p3.
Now - how can I do this using the methods on the Repository class of Symfony 3.4 like described here:
https://symfony.com/doc/3.4/doctrine.html
Or are there any other ways to achieve what I am looking for?
Any hints are very welcome.
EDIT: Basically I am looking for a list of all existing combinations of p1, p2, p3 without having a combination doubled in the list. It doesn't matter which row is returned in the result set (regarding the properties id and q) as long as one (and only one) row of each combination of p1, p2, p3 is included.