Doctrine2 fetching rows that have manyToMany association by QueryBuilder
问题 everyone. I have 2 entities City and POI. Mapping looks like this: class City { /** * @ORM\ManyToMany(targetEntity="POI", mappedBy="cities") * @ORM\OrderBy({"position" = "ASC"}) */ protected $pois; and class POI { /** * @ORM\ManyToMany(targetEntity="City", inversedBy="pois") * @ORM\JoinTable(name="poi_cities") */ protected $cities; I would like to fetch all POIs that have at least 1 association with some City using QueryBuilder. I should probably use exists() function but I don't quiet know