Doctrine QueryBuilder - Exclude articles linked to specific themes
问题 I'm working on a Symfony2 project using Doctrine2. I have a 'article' and a 'theme' table in a many-to-many relationship. I am trying to get every articles except those linked to theme 35. $query = $this->createQueryBuilder('art') ->join('art.themes', 'the') ->where('the != '.35) ->getQuery() ->getResult(); This request only works when my article has only one theme. If the article has more than one (for example theme 35 + theme 36), it's not excluded from the results. How can I fix this? Here