Doctrine 2 DQL - how to select inverse side of unidirectional many-to-many query?
问题 I have two classes - Page and SiteVersion, which have a many to many relationship. Only SiteVersion is aware of the relationship (because the site is modular and I want to be able to take away and drop in the module that SiteVersion belongs to). How would I therefore select pages based on criteria of SiteVersion? For example, this doesn't work: SELECT p FROM SiteVersion v JOIN v.pages p WHERE v.id = 5 AND p.slug='index' I get the error: [Doctrine\ORM\Query\QueryException] [Semantical Error]