Answer the question
In order to leave comments, you need to log in
How to set filter for OneToMany relation in Symfony2?
You need to create a filter based on an array. That is, there is a one-to-many relationship, the relationship is established ("portfolio" - "portfolio-category"). At the input I have an array of ID categories, you need to get those values in which the categories specified for the portfolio fully correspond to the array of categories.
Answer the question
In order to leave comments, you need to log in
Possibly like this:
$array = []; // массив ваших id-шников
$this->em->getRepository('%repoName%')->findBy(['id'] => $array);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question